[JS] Remove Ant js test

This commit is contained in:
Ilya Goncharov
2023-06-13 17:01:21 +02:00
committed by Space Team
parent b0b266b73d
commit 0ac0c51c23
76 changed files with 0 additions and 960 deletions
@@ -1,10 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/hello.kt] => [[Temp]/out.js]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,10 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js src="${test.data}/hello.kt" output="${temp}/out.js">
<compilerarg value="-Xno-inline"/>
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
</target>
</project>
@@ -1,13 +0,0 @@
package foo
inline fun foo(f: () -> Unit) = f()
var ok = "Fail"
fun main() {
foo {
ok = "OK"
}
}
fun box(): String = ok
@@ -1,10 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,12 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js src="${test.data}/root1"
output="${temp}/out.js"
outputPrefix="${test.data}/prefix"
outputPostfix="${test.data}/postfix">
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
</target>
</project>
@@ -1,3 +0,0 @@
/*
some postfix
*/
@@ -1,3 +0,0 @@
/*
some prefix
*/
@@ -1,3 +0,0 @@
package foo
fun box(): String = "OK"
@@ -1,3 +0,0 @@
package bar
fun bar() {}
@@ -1,10 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1, [TestData]/bar.kt, [TestData]/root2/Foo.kt] => [[Temp]/out.js]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,15 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" >
<src>
<pathelement path="${test.data}/bar.kt"/>
<fileset dir="${test.data}/root2">
<include name="**/*.kt"/>
</fileset>
</src>
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
</target>
</project>
@@ -1,7 +0,0 @@
package foo
fun box(): String {
Foo()
bar.bar()
return "OK"
}
@@ -1 +0,0 @@
function Bar () {}
@@ -1,3 +0,0 @@
package foo
class Foo
@@ -1,13 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
ERR:
BUILD FAILED
[TestData]/build.xml:5: "output" should be specified
Total time: [time]
Return code: 1
@@ -1,7 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js src="${test.data}/root1"/>
</target>
</project>
@@ -1,13 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
ERR:
BUILD FAILED
[TestData]/build.xml:5: "src" should be specified
Total time: [time]
Return code: 1
@@ -1,7 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js output="${temp}/out.js"/>
</target>
</project>
@@ -1,10 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,9 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" outputPostfix="${test.data}/postfix">
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
</target>
</project>
@@ -1,3 +0,0 @@
/*
some postfix
*/
@@ -1,3 +0,0 @@
package foo
fun box(): String = "OK"
@@ -1,10 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,9 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" outputPrefix="${test.data}/prefix">
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
</target>
</project>
@@ -1,3 +0,0 @@
/*
some prefix
*/
@@ -1,3 +0,0 @@
package foo
fun box(): String = "OK"
@@ -1,9 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,15 +0,0 @@
<project name="Ant Task Test" default="build">
<target name="build">
<java dir="${temp}" fork="true" classname="org.jetbrains.kotlin.cli.js.K2JSCompiler">
<classpath>
<pathelement location="${kotlin.lib}/kotlin-compiler.jar"/>
<pathelement location="${kotlin.lib}/kotlin-stdlib.jar"/>
</classpath>
<arg value="${test.data}/root1/foo.kt"/>
<arg value="-Xforce-deprecated-legacy-compiler-usage"/>
<arg value="-output"/>
<arg value="out.js"/>
<jvmarg value="-noverify"/>
</java>
</target>
</project>
@@ -1,3 +0,0 @@
package foo
fun box(): String = "OK"
@@ -1,10 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
-9
View File
@@ -1,9 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call">
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
</target>
</project>
@@ -1,12 +0,0 @@
package foo
var ok = "FAIL"
val hello = Pair("Hello", "World")
fun main() {
ok = "OK"
println(hello.first + " " + hello.second)
}
fun box(): String = ok
@@ -1,39 +0,0 @@
(function(global) {
var modules = {};
modules.kotlin = kotlin;
// Hard-code expected dependency order since we are unable to refer to modules by filename here.
var names = ["jslib-example", "out"];
function define(name, dependencies, body) {
if (Array.isArray(name)) {
body = dependencies;
dependencies = name;
name = names.shift();
}
else {
if (name !== names.shift()) throw new Error("Unexpected dependency")
}
var resolvedDependencies = [];
var currentModule = {};
modules[name] = currentModule;
for (var i = 0; i < dependencies.length; ++i) {
var dependencyName = dependencies[i];
resolvedDependencies[i] = dependencyName === 'exports' ? currentModule : modules[dependencyName];
}
currentModule = body.apply(body, resolvedDependencies);
if (currentModule) {
modules[name] = currentModule;
}
}
define.amd = {};
function require(name) {
return modules[name];
}
global.define = define;
global.$kotlin_test_internal$ = {
require : require
};
})(this);
@@ -1,14 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[mkdir] Created dir: [Temp]/lib
[kotlin2js] Compiling [[TestData]/jslib-example] => [[Temp]/lib/jslib-example.js]
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
[copy] Copying 2 files to [Temp]
[copy] Copying 1 file to [Temp]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,26 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<property name="library.path" value="${test.data}/jslib-example"/>
<property name="temp.library.path" value="${temp}/lib"/>
<target name="build">
<mkdir dir="${temp.library.path}"/>
<kotlin2js src="${library.path}" output="${temp.library.path}/jslib-example.js" metaInfo="true" moduleKind="umd">
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call" moduleKind="amd">
<libraries>
<pathelement path="${temp.library.path}/jslib-example.meta.js"/>
</libraries>
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
<copy todir="${temp}">
<fileset dir="${temp.library.path}">
<include name="**/*.js"/>
<exclude name="META-INF/**"/>
</fileset>
</copy>
<copy todir="${temp}" file="${test.data}/amd.js"/>
</target>
</project>
@@ -1,9 +0,0 @@
package library.sample
import kotlin.js.Date
public class ClassA() {
val value: Int = 100
}
public fun Date.extFun(): Int = 100
@@ -1,17 +0,0 @@
package foo
import library.sample.*
import kotlin.js.Date
var ok = "FAIL"
fun main() {
val x = ClassA().value
if (x == 100) {
ok = "OK"
}
val date = Date()
println(date.extFun())
}
fun box(): String = ok
@@ -1,18 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[mkdir] Created dir: [Temp]/lib
[kotlin2js] Compiling [[TestData]/jslib-example1] => [[Temp]/lib/jslib-example1.js]
[kotlin2js] Compiling [[TestData]/jslib-example2] => [[Temp]/lib/jslib-example2.js]
[delete] Deleting: [Temp]/lib/jslib-example1.js
[delete] Deleting: [Temp]/lib/jslib-example2.js
[delete] Deleting: [Temp]/lib/jslib-example1.meta.js
[delete] Deleting: [Temp]/lib/jslib-example2.meta.js
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
[copy] Copying 1 file to [Temp]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,44 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<property name="library.path1" value="${test.data}/jslib-example1"/>
<property name="library.path2" value="${test.data}/jslib-example2"/>
<property name="temp.library.path" value="${temp}/lib"/>
<target name="build">
<mkdir dir="${temp.library.path}"/>
<kotlin2js src="${library.path1}" output="${temp.library.path}/jslib-example1.js" metaInfo="true">
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
<kotlin2js src="${library.path2}" output="${temp.library.path}/jslib-example2.js" metaInfo="true">
<libraries>
<pathelement path="${temp.library.path}/jslib-example1.meta.js"/>
</libraries>
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
<concat destfile="${temp.library.path}/jslib-example.js">
<fileset file="${temp.library.path}/jslib-example1.js"/>
<fileset file="${temp.library.path}/jslib-example2.js"/>
<fileset file="${temp.library.path}/jslib-example1.meta.js"/>
<fileset file="${temp.library.path}/jslib-example2.meta.js"/>
</concat>
<delete file="${temp.library.path}/jslib-example1.js"/>
<delete file="${temp.library.path}/jslib-example2.js"/>
<delete file="${temp.library.path}/jslib-example1.meta.js"/>
<delete file="${temp.library.path}/jslib-example2.meta.js"/>
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call">
<libraries>
<pathelement path="${temp.library.path}/jslib-example.js"/>
</libraries>
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
<copy todir="${temp}">
<fileset dir="${temp.library.path}">
<include name="**/*.js"/>
<exclude name="META-INF/**"/>
</fileset>
</copy>
</target>
</project>
@@ -1,9 +0,0 @@
package library.sample
import kotlin.js.Date
public class ClassA() {
val value: Int = 100
}
public fun Date.extFun(): String = "Date.extFun"
@@ -1,3 +0,0 @@
package library.sample
public fun ClassA.extFun(): String = "ClassA.extFun"
@@ -1,15 +0,0 @@
package foo
import library.sample.*
import kotlin.js.Date
var ok = "FAIL"
fun main() {
val x = ClassA().value
if (x == 100 && Date().extFun() == "Date.extFun" && ClassA().extFun() == "ClassA.extFun") {
ok = "OK"
}
}
fun box(): String = ok
@@ -1,10 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,9 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call">
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
</target>
</project>
@@ -1,9 +0,0 @@
package foo
var ok = "FAIL"
fun main() {
ok = "OK"
}
fun box(): String = ok
@@ -1,10 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,9 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call">
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
</target>
</project>
@@ -1,10 +0,0 @@
package foo
var ok = "FAIL"
fun main(args: kotlin.Array<kotlin.String>) {
args.size
ok = "OK"
}
fun box(): String = ok
@@ -1,14 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[mkdir] Created dir: [Temp]/lib
[kotlin2js] Compiling [[TestData]/jslib-example1] => [[Temp]/lib/jslib-example1.js]
[kotlin2js] Compiling [[TestData]/jslib-example2] => [[Temp]/lib/jslib-example2.js]
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
[copy] Copying 4 files to [Temp]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,33 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<property name="library.path1" value="${test.data}/jslib-example1"/>
<property name="library.path2" value="${test.data}/jslib-example2"/>
<property name="temp.library.path" value="${temp}/lib"/>
<target name="build">
<mkdir dir="${temp.library.path}"/>
<kotlin2js src="${library.path1}" output="${temp.library.path}/jslib-example1.js" metaInfo="true">
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
<kotlin2js src="${library.path2}" output="${temp.library.path}/jslib-example2.js" metaInfo="true">
<libraries>
<pathelement path="${temp.library.path}/jslib-example1.meta.js"/>
</libraries>
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call">
<libraries>
<pathelement path="${temp.library.path}/jslib-example1.meta.js"/>
<pathelement path="${temp.library.path}/jslib-example2.meta.js"/>
</libraries>
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
<copy todir="${temp}">
<fileset dir="${temp.library.path}">
<include name="**/*.js"/>
<exclude name="META-INF/**"/>
</fileset>
</copy>
</target>
</project>
@@ -1,9 +0,0 @@
package library.sample
import kotlin.js.Date
public class ClassA() {
val value: Int = 100
}
public fun Date.extFun(): String = "Date.extFun"
@@ -1,3 +0,0 @@
package library.sample
public fun ClassA.extFun(): String = "ClassA.extFun"
@@ -1,15 +0,0 @@
package foo
import library.sample.*
import kotlin.js.Date
var ok = "FAIL"
fun main() {
val x = ClassA().value
if (x == 100 && Date().extFun() == "Date.extFun" && ClassA().extFun() == "ClassA.extFun") {
ok = "OK"
}
}
fun box(): String = ok
@@ -1,10 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,9 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call">
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
</target>
</project>
@@ -1,10 +0,0 @@
package foo
var ok = "FAIL"
fun main(vararg args: kotlin.String) {
args.size
ok = "OK"
}
fun box(): String = ok
@@ -1,10 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,9 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js src="${test.data}/root1" noStdlib="true" output="${temp}/out.js">
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
</target>
</project>
@@ -1,3 +0,0 @@
package foo
fun box(): String = "OK"
@@ -1,13 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[mkdir] Created dir: [Temp]/lib
[kotlin2js] Compiling [[TestData]/jslib-example] => [[Temp]/lib/jslib-example.js]
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
[copy] Copying 2 files to [Temp]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,25 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<property name="library.path" value="${test.data}/jslib-example"/>
<property name="temp.library.path" value="${temp}/lib"/>
<target name="build">
<mkdir dir="${temp.library.path}"/>
<kotlin2js src="${library.path}" noStdlib="true" output="${temp.library.path}/jslib-example.js" metaInfo="true">
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
<kotlin2js src="${test.data}/root1" noStdlib="true" output="${temp}/out.js" main="call">
<libraries>
<pathelement path="${temp.library.path}/jslib-example.meta.js"/>
</libraries>
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
<copy todir="${temp}">
<fileset dir="${temp.library.path}">
<include name="**/*.js"/>
<exclude name="META-INF/**"/>
</fileset>
</copy>
</target>
</project>
@@ -1,6 +0,0 @@
package library.sample
public class ClassA() {
val value: Int = 100
}
@@ -1,14 +0,0 @@
package foo
import library.sample.*
var ok = "FAIL"
fun main() {
val x = ClassA().value
if (x == 100) {
ok = "OK"
}
}
fun box(): String = ok
@@ -1,10 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,9 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" sourcemap="true">
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
</target>
</project>
@@ -1,3 +0,0 @@
package foo
fun box(): String = "OK"
@@ -1,10 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,9 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" nowarn="true">
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
</target>
</project>
@@ -1,13 +0,0 @@
package foo
import kotlin.Any
fun foo(p: Int??) {
}
interface T {
abstract fun foo()
}
fun box(): String = "OK"
@@ -1,13 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
[kotlin2js] logging: using Kotlin home directory [KotlinProjectHome]/dist/kotlinc
[kotlin2js] logging: exception on loading scripting plugin: java.lang.ClassNotFoundException: org.jetbrains.kotlin.scripting.compiler.plugin.ScriptingCompilerConfigurationComponentRegistrar
[kotlin2js] logging: compiling source files: [TestData]/root1/foo.kt
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,9 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" verbose="true">
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
</target>
</project>
@@ -1,3 +0,0 @@
package foo
fun box(): String = "OK"
@@ -1,11 +0,0 @@
OUT:
Buildfile: [TestData]/build.xml
build:
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
[kotlin2js] info: kotlinc-js [KotlinVersion] (JRE [JREVersion])
BUILD SUCCESSFUL
Total time: [time]
Return code: 0
@@ -1,9 +0,0 @@
<project name="Ant Task Test" default="build">
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
<target name="build">
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" printVersion="true">
<compilerarg value="-Xforce-deprecated-legacy-compiler-usage"/>
</kotlin2js>
</target>
</project>
@@ -1,3 +0,0 @@
package foo
fun box(): String = "OK"
@@ -1,173 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.integration;
import com.intellij.openapi.util.io.FileUtil;
import kotlin.collections.CollectionsKt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.js.testOld.NashornJsTestChecker;
import org.jetbrains.kotlin.js.testOld.V8JsTestChecker;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class AntTaskJsTest extends AbstractAntTaskTest {
private static final String JS_OUT_FILE = "out.js";
private static final Boolean useNashorn = Boolean.getBoolean("kotlin.js.useNashorn");
@NotNull
private String getTestDataDir() {
return KtTestUtil.getTestDataPathBase() + "/integration/ant/js/" + getTestName(true);
}
@NotNull
private File getOutputFileByName(@NotNull String name) {
return new File(tmpdir, name);
}
private void doTest() throws Exception {
doTest(getTestDataDir());
}
private void doJsAntTest(String... jsFiles) throws Exception {
doJsAntTest(false, jsFiles);
}
private void doJsAntTest(boolean withModuleSystem, String... jsFiles) throws Exception {
doTest();
List<String> fileNames = new ArrayList<>(Arrays.asList(jsFiles));
fileNames.add(JS_OUT_FILE);
List<String> filePaths = CollectionsKt.map(fileNames, s -> getOutputFileByName(s).getAbsolutePath());
(useNashorn ? NashornJsTestChecker.INSTANCE : V8JsTestChecker.INSTANCE).check(filePaths, "out", "foo", "box", "OK", withModuleSystem, null);
}
private void doJsAntTestForPostfixPrefix(@Nullable String prefix, @Nullable String postfix) throws Exception {
doJsAntTest();
File outputFile = getOutputFileByName(JS_OUT_FILE);
File prefixFile = prefix != null ? new File(getTestDataDir(), prefix) : null;
File postfixFile = postfix != null ? new File(getTestDataDir(), postfix) : null;
checkFilePrefixPostfix(outputFile, prefixFile, postfixFile);
}
private static void checkFilePrefixPostfix(@NotNull File file, @Nullable File prefix, @Nullable File postfix) throws IOException {
String fileContent = FileUtil.loadFile(file, true);
if (prefix != null) {
String prefixContent = FileUtil.loadFile(prefix, true);
assertTrue(fileContent.startsWith(prefixContent));
}
if (postfix != null) {
String postfixContent = FileUtil.loadFile(postfix, true);
assertTrue(fileContent.endsWith(postfixContent));
}
}
public void testSimple() throws Exception {
doJsAntTest();
}
public void testSimpleWithMain() throws Exception {
doJsAntTest();
}
public void testSimpleWithoutStdlib() throws Exception {
doJsAntTest();
}
public void testSimpleWithoutStdlibAndFolderAsAnotherLib() throws Exception {
doJsAntTest("jslib-example.js");
}
public void testSimpleWithoutStdlibAndJsFileAsAnotherLib() throws Exception {
doJsAntTest("jslib-example.js");
}
public void testSimpleWithJsFileAsAnotherLib() throws Exception {
doJsAntTest("jslib-example.js");
}
public void testSimpleWithJsFileAsAnotherLibModuleKind() throws Exception {
doJsAntTest(true, "amd.js", "jslib-example.js");
}
public void testSimpleWithTwoJsFilesAsLibraries() throws Exception {
doJsAntTest("jslib-example1.js", "jslib-example2.js");
}
public void testSimpleWithJsFilesWithTwoModulesAsLibrary() throws Exception {
doJsAntTest("jslib-example.js");
}
public void testSimpleWithMainFQArgs() throws Exception {
doJsAntTest();
}
public void testSimpleWithVarargMain() throws Exception {
doJsAntTest();
}
public void testManySources() throws Exception {
doJsAntTest();
}
public void testAdditionalArguments() throws Exception {
doJsAntTest();
}
public void testSuppressWarnings() throws Exception {
doJsAntTest();
}
public void testVerbose() throws Exception {
doJsAntTest();
}
public void testVersion() throws Exception {
doJsAntTest();
}
public void testOutputWithoutDirectory() throws Exception {
doJsAntTest();
}
public void testNoSrcParam() throws Exception {
doTest();
}
public void testNoOutputParam() throws Exception {
doTest();
}
public void testOutputPrefix() throws Exception {
doJsAntTestForPostfixPrefix("prefix", null);
}
public void testOutputPostfix() throws Exception {
doJsAntTestForPostfixPrefix(null, "postfix");
}
public void testBothPrefixAndPostfix() throws Exception {
doJsAntTestForPostfixPrefix("prefix", "postfix");
}
public void testSourceMap() throws Exception {
doJsAntTest();
File sourceMap = getOutputFileByName(JS_OUT_FILE + ".map");
assertTrue("Source map file \"" + sourceMap.getAbsolutePath() + "\" not found", sourceMap.exists());
}
}