Separated test data depending on target platform (JS/JVM)

This commit is contained in:
Evgeny Gerashchenko
2013-11-20 21:00:25 +04:00
parent f06e46951f
commit d937909ebf
54 changed files with 23 additions and 22 deletions
@@ -0,0 +1,4 @@
-src
$TESTDATA_DIR$/diagnosticsOrder1.kt:$TESTDATA_DIR$/diagnosticsOrder2.kt
-output
$TEMP_DIR$
@@ -0,0 +1,10 @@
ERROR: $TESTDATA_DIR$/diagnosticsOrder1.kt: (1, 5) Redeclaration: x
ERROR: $TESTDATA_DIR$/diagnosticsOrder1.kt: (2, 5) Redeclaration: x
ERROR: $TESTDATA_DIR$/diagnosticsOrder1.kt: (3, 5) Redeclaration: x
ERROR: $TESTDATA_DIR$/diagnosticsOrder1.kt: (4, 5) Redeclaration: x
ERROR: $TESTDATA_DIR$/diagnosticsOrder1.kt: (5, 5) Redeclaration: x
ERROR: $TESTDATA_DIR$/diagnosticsOrder1.kt: (6, 5) Redeclaration: x
ERROR: $TESTDATA_DIR$/diagnosticsOrder1.kt: (7, 5) Redeclaration: x
ERROR: $TESTDATA_DIR$/diagnosticsOrder2.kt: (1, 5) Redeclaration: y
ERROR: $TESTDATA_DIR$/diagnosticsOrder2.kt: (2, 5) Redeclaration: y
COMPILATION_ERROR
@@ -0,0 +1,7 @@
val x = 5
val x = 5
val x = 5
val x = 5
val x = 5
val x = 5
val x = 5
@@ -0,0 +1,2 @@
val y = 5
val y = 5
+1
View File
@@ -0,0 +1 @@
println("hello")
+1
View File
@@ -0,0 +1 @@
-help
+22
View File
@@ -0,0 +1,22 @@
Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments
-jar [String] jar file name
-src [String] source file or directory (allows many paths separated by the system path separator)
-classpath [String] classpath to use when compiling
-annotations [String] paths to external annotations
-includeRuntime [flag] include Kotlin runtime in to resulting jar
-noJdk [flag] don't include Java runtime into classpath
-noStdlib [flag] don't include Kotlin runtime into classpath
-noJdkAnnotations [flag] don't include JDK external annotations into classpath
-notNullAssertions [flag] generate not-null assertion after each invokation of method returning not-null
-notNullParamAssertions [flag] generate not-null assertions on parameters of methods accessible from Java
-output [String] output directory
-module [String] module to compile
-script [flag] evaluate script
-kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery
-tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag
-verbose [flag] Enable verbose logging output
-version [flag] Display compiler version
-help (-h) [flag] Show help
-suppress [String] Suppress compiler messages by severity (warnings)
-printArgs [flag] Print commandline arguments
OK
@@ -0,0 +1,4 @@
-src
$TESTDATA_DIR$/multipleTextRangesInDiagnosticsOrder.kt
-output
$TEMP_DIR$
@@ -0,0 +1,7 @@
trait A {
public val c: Int
}
trait B: A {
override protected private val c: Int
}
@@ -0,0 +1,4 @@
ERROR: $TESTDATA_DIR$/multipleTextRangesInDiagnosticsOrder.kt: (6, 14) Cannot weaken access privilege 'public' for 'c' in 'A'
ERROR: $TESTDATA_DIR$/multipleTextRangesInDiagnosticsOrder.kt: (6, 14) Incompatible modifiers: 'private protected'
ERROR: $TESTDATA_DIR$/multipleTextRangesInDiagnosticsOrder.kt: (6, 24) Incompatible modifiers: 'private protected'
COMPILATION_ERROR
@@ -0,0 +1,8 @@
-src
$TESTDATA_DIR$/simple.kt
-classpath
not/existing/path
-annotations
yet/another/not/existing/path
-output
$TEMP_DIR$
@@ -0,0 +1,3 @@
WARNING: Classpath entry points to a non-existent location: not/existing/path
WARNING: Annotations path entry points to a non-existent location: yet/another/not/existing/path
OK
@@ -0,0 +1,4 @@
-src
not/existing/path
-output
$TEMP_DIR$
@@ -0,0 +1,2 @@
ERROR: Source file or directory not found: not/existing/path
COMPILATION_ERROR
@@ -0,0 +1,3 @@
-printArgs
-script
$TESTDATA_DIR$/hello.ktscript
@@ -0,0 +1,3 @@
INFO: Invoking compiler org.jetbrains.jet.cli.jvm.K2JVMCompiler with arguments -printArgs -script compiler/testData/cli/jvm/hello.ktscript
hello
OK
+4
View File
@@ -0,0 +1,4 @@
-script
$TESTDATA_DIR$/script.ktscript
hi
there
@@ -0,0 +1,3 @@
for (arg in args) {
println(arg)
}
+3
View File
@@ -0,0 +1,3 @@
hi
there
OK
+4
View File
@@ -0,0 +1,4 @@
-src
$TESTDATA_DIR$/simple.kt
-output
$TEMP_DIR$
+1
View File
@@ -0,0 +1 @@
fun main(args: Array<String>) = println("hello world")
+1
View File
@@ -0,0 +1 @@
OK
@@ -0,0 +1,6 @@
-src
$TESTDATA_DIR$/../warnings.kt
-suppress
warnings
-output
$TEMP_DIR$
@@ -0,0 +1 @@
OK
@@ -0,0 +1,6 @@
-src
$TESTDATA_DIR$/../warnings.kt
-suppress
WaRnInGs
-output
$TEMP_DIR$
@@ -0,0 +1 @@
OK
@@ -0,0 +1,6 @@
-src
$TESTDATA_DIR$/wrongAbiVersion.kt
-classpath
$TESTDATA_DIR$/wrongAbiVersionLib
-output
$TEMP_DIR$
@@ -0,0 +1,5 @@
import wrong.*
fun foo(x: ClassWithWrongAbiVersion) {
bar()
}
@@ -0,0 +1,5 @@
WARNING: $TESTDATA_DIR$/wrongAbiVersion.kt: (3, 9) Parameter 'x' is never used
ERROR: $TESTDATA_DIR$/wrongAbiVersion.kt: (4, 3) Unresolved reference: bar
ERROR: $TESTDATA_DIR$/wrongAbiVersionLib/wrong/WrongPackage.class: (0, 0) Class 'wrong/WrongPackage' was compiled with an incompatible version of Kotlin. Its ABI version is -1, expected ABI version is 11
ERROR: $TESTDATA_DIR$/wrongAbiVersionLib/ClassWithWrongAbiVersion.class: (0, 0) Class 'ClassWithWrongAbiVersion' was compiled with an incompatible version of Kotlin. Its ABI version is -1, expected ABI version is 11
COMPILATION_ERROR
@@ -0,0 +1,13 @@
/*
To regenerate this test:
1. Change JvmAbi.VERSION to -1
2. Run 'ant dist'
3. Rename this file and wrong-package: delete 'txt' extension
4. Compile two files with the newly built compiler from dist/
5. Rename files back: add 'txt' extension
6. Change JvmAbi.VERSION back to its old value
7. Run 'ant dist'
After these steps, the test should succeed
*/
class ClassWithWrongAbiVersion
@@ -0,0 +1,3 @@
package wrong
fun bar() {}
@@ -0,0 +1 @@
-wrongArgument
@@ -0,0 +1,23 @@
Invalid argument: -wrongArgument
Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments
-jar [String] jar file name
-src [String] source file or directory (allows many paths separated by the system path separator)
-classpath [String] classpath to use when compiling
-annotations [String] paths to external annotations
-includeRuntime [flag] include Kotlin runtime in to resulting jar
-noJdk [flag] don't include Java runtime into classpath
-noStdlib [flag] don't include Kotlin runtime into classpath
-noJdkAnnotations [flag] don't include JDK external annotations into classpath
-notNullAssertions [flag] generate not-null assertion after each invokation of method returning not-null
-notNullParamAssertions [flag] generate not-null assertions on parameters of methods accessible from Java
-output [String] output directory
-module [String] module to compile
-script [flag] evaluate script
-kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery
-tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag
-verbose [flag] Enable verbose logging output
-version [flag] Display compiler version
-help (-h) [flag] Show help
-suppress [String] Suppress compiler messages by severity (warnings)
-printArgs [flag] Print commandline arguments
INTERNAL_ERROR
@@ -0,0 +1,6 @@
-src
$TESTDATA_DIR$/wrongKotlinSignature.kt
-classpath
$TESTDATA_DIR$/wrongKotlinSignatureLib
-output
$TEMP_DIR$
@@ -0,0 +1,4 @@
package test;
val x = ClassWithWrongKotlinSignatures.foo()
val y = ClassWithWrongKotlinSignatures.bar()
@@ -0,0 +1,7 @@
ERROR: The following Java entities have annotations with wrong Kotlin signatures:
ClassWithWrongKotlinSignatures java.lang.String foo():
Function names mismatch, original: foo, alternative: bar
ClassWithWrongKotlinSignatures java.lang.String bar():
Function names mismatch, original: bar, alternative: foo
COMPILATION_ERROR
@@ -0,0 +1,13 @@
import jet.runtime.typeinfo.KotlinSignature;
public class ClassWithWrongKotlinSignatures {
@KotlinSignature("fun bar() : String")
public static String foo() {
throw new UnsupportedOperationException();
}
@KotlinSignature("fun foo() : String")
public static String bar() {
throw new UnsupportedOperationException();
}
}