From d011fa8dc62f37d2f09aa5f403699d183f8b8cd6 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Thu, 3 Mar 2016 14:25:35 +0300 Subject: [PATCH] Add FULL_JDK to tests in codegen/boxWithStdlib/fullJdk/ Drop the old scheme which relied on the directory name --- .../againstMultifileStdlib/useStdlib.kt | 2 - .../boxWithStdlib/fullJdk/charBuffer.kt | 2 + .../boxWithStdlib/fullJdk/classpath.kt | 4 +- .../boxWithStdlib/fullJdk/constFlags.kt | 2 + .../boxWithStdlib/fullJdk/ifInWhile.kt | 2 +- .../fullJdk/intCountDownLatchExtension.kt | 2 + .../fullJdk/jvmAnnotationFlags.kt | 2 + .../codegen/boxWithStdlib/fullJdk/kt2423.kt | 2 + .../codegen/boxWithStdlib/fullJdk/kt434.kt | 4 +- .../fullJdk/lateinitVisibility.kt | 6 ++- .../boxWithStdlib/fullJdk/native/default.kt | 6 +-- .../fullJdk/native/nativePropertyAccessors.kt | 4 +- .../fullJdk/native/privateStatic.kt | 4 +- .../fullJdk/native/simpleNative.kt | 4 +- .../fullJdk/native/staticNative.kt | 6 +-- .../boxWithStdlib/fullJdk/native/topLevel.kt | 6 +-- .../platformTypeAssertionStackTrace.kt | 2 + .../fullJdk/regressions/collections.kt | 2 + .../fullJdk/regressions/kt1202.kt | 2 + .../fullJdk/regressions/kt1406.kt | 2 + .../fullJdk/regressions/kt1770.kt | 4 +- .../fullJdk/regressions/kt274.kt | 2 +- .../fullJdk/regressions/kt528.kt | 2 + .../fullJdk/regressions/kt529.kt | 2 + .../fullJdk/regressions/kt533.kt | 2 + .../fullJdk/regressions/kt6485.kt | 2 + .../fullJdk/regressions/kt864.kt | 2 + .../boxWithStdlib/fullJdk/smap/chainCalls.kt | 12 +++-- .../boxWithStdlib/fullJdk/smap/infixCalls.kt | 10 ++-- .../fullJdk/smap/simpleCallWithParams.kt | 16 +++--- .../fullJdk/synchronized/changeMonitor.kt | 4 +- .../fullJdk/synchronized/finally.kt | 4 +- .../fullJdk/synchronized/nonLocalReturn.kt | 4 +- .../fullJdk/synchronized/sync.kt | 4 +- .../fullJdk/synchronized/wait.kt | 4 +- .../genericBackingFieldSignature.kt | 0 .../genericMethodSignature.kt | 0 .../{fullJdk => regressions}/kt2509.kt | 0 .../codegen/AbstractBlackBoxCodegenTest.java | 17 ++----- ...lackBoxWithStdlibCodegenTestGenerated.java | 51 +++++++------------ 40 files changed, 119 insertions(+), 89 deletions(-) delete mode 100644 compiler/testData/codegen/boxWithStdlib/againstMultifileStdlib/useStdlib.kt rename compiler/testData/codegen/boxWithStdlib/{fullJdk => reflection/genericSignature}/genericBackingFieldSignature.kt (100%) rename compiler/testData/codegen/boxWithStdlib/{fullJdk => reflection/genericSignature}/genericMethodSignature.kt (100%) rename compiler/testData/codegen/boxWithStdlib/{fullJdk => regressions}/kt2509.kt (100%) diff --git a/compiler/testData/codegen/boxWithStdlib/againstMultifileStdlib/useStdlib.kt b/compiler/testData/codegen/boxWithStdlib/againstMultifileStdlib/useStdlib.kt deleted file mode 100644 index d73f9537f8d..00000000000 --- a/compiler/testData/codegen/boxWithStdlib/againstMultifileStdlib/useStdlib.kt +++ /dev/null @@ -1,2 +0,0 @@ -fun box(): String = - listOf("a").map { "OK" }.get(0) \ No newline at end of file diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/charBuffer.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/charBuffer.kt index a2f45009a43..c34ada7ab53 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/charBuffer.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/charBuffer.kt @@ -1,3 +1,5 @@ +// FULL_JDK + import java.nio.CharBuffer fun box(): String { diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/classpath.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/classpath.kt index 37942435186..e018845a68f 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/classpath.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/classpath.kt @@ -1,3 +1,5 @@ +// FULL_JDK + import sun.nio.cs.ext.Big5 import sun.net.spi.nameservice.dns.DNSNameService import javax.crypto.Cipher @@ -11,4 +13,4 @@ fun box(): String { val f : SunJCE? = null // sunjce_provider.jar val j : ByteBuffered? = null // rt.jar return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/constFlags.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/constFlags.kt index 216bb8292ca..9b799346055 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/constFlags.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/constFlags.kt @@ -1,3 +1,5 @@ +// FULL_JDK + @file:JvmName("XYZ") import java.lang.reflect.Modifier diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/ifInWhile.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/ifInWhile.kt index 01ff1ddb8af..395dfdef005 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/ifInWhile.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/ifInWhile.kt @@ -1,4 +1,4 @@ -import java.lang.Runtime +// FULL_JDK fun box() : String { val processors = Runtime.getRuntime()!!.availableProcessors() diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/intCountDownLatchExtension.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/intCountDownLatchExtension.kt index afb390f614c..1cfa240e57b 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/intCountDownLatchExtension.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/intCountDownLatchExtension.kt @@ -1,3 +1,5 @@ +// FULL_JDK + import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.CountDownLatch; import java.util.concurrent.locks.ReentrantLock; diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/jvmAnnotationFlags.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/jvmAnnotationFlags.kt index f15f9f8283b..b33b1978504 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/jvmAnnotationFlags.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/jvmAnnotationFlags.kt @@ -1,3 +1,5 @@ +// FULL_JDK + import java.lang.reflect.Modifier import kotlin.reflect.KProperty diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/kt2423.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/kt2423.kt index fcac4e1292f..d1de819df3b 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/kt2423.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/kt2423.kt @@ -1,3 +1,5 @@ +// FULL_JDK + import java.util.LinkedList fun ok1(): Boolean { diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/kt434.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/kt434.kt index e656a6a04b4..b8a98ceca1f 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/kt434.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/kt434.kt @@ -1,3 +1,5 @@ +// FULL_JDK + import java.net.* fun String.decodeURI(encoding : String) : String? = @@ -10,4 +12,4 @@ fun String.decodeURI(encoding : String) : String? = fun box() : String { return if("hhh".decodeURI("") == null) "OK" else "fail" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/lateinitVisibility.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/lateinitVisibility.kt index 35ba639b9a6..9b17ec24ff3 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/lateinitVisibility.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/lateinitVisibility.kt @@ -1,3 +1,5 @@ +// FULL_JDK + import java.lang.reflect.Modifier public class A { @@ -19,10 +21,10 @@ public class A { return if (cond.isEmpty()) "OK" else cond.joinToString() } - return "EXCEPTION WAS NOT CATCHED" + return "EXCEPTION WAS NOT CAUGHT" } } fun box(): String { return A().test() -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/default.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/default.kt index 85c1216adb8..ef9209a1f7f 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/default.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/default.kt @@ -1,6 +1,6 @@ -package foo +// FULL_JDK -import kotlin.jvm.* +package foo object ObjWithNative { external fun foo(x: Int = 1): Double @@ -37,4 +37,4 @@ fun box(): String { if (e.message != "foo.DefaultKt.topLevel(I)D") return "Fail 3: " + e.message } return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/nativePropertyAccessors.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/nativePropertyAccessors.kt index a287e244fff..e1129893e1d 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/nativePropertyAccessors.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/nativePropertyAccessors.kt @@ -1,3 +1,5 @@ +// FULL_JDK + class C { companion object { val defaultGetter: Int = 1 @@ -46,4 +48,4 @@ fun box(): String { ?: check({C().defaultSetter = 1}, "C.setDefaultSetter(I)V") ?: "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/privateStatic.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/privateStatic.kt index 70c7c54215c..fce9961ae83 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/privateStatic.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/privateStatic.kt @@ -1,4 +1,4 @@ -import kotlin.jvm.* +// FULL_JDK class C { companion object { @@ -20,4 +20,4 @@ fun box(): String { } return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/simpleNative.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/simpleNative.kt index f9bb6af036b..ee75e26a68d 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/simpleNative.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/simpleNative.kt @@ -1,3 +1,5 @@ +// FULL_JDK + package foo import kotlin.jvm.* @@ -14,4 +16,4 @@ fun box(): String { catch (e: java.lang.UnsatisfiedLinkError) { return "OK" } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/staticNative.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/staticNative.kt index f7689b3967c..4c4d4d1f416 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/staticNative.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/staticNative.kt @@ -1,6 +1,6 @@ -package foo +// FULL_JDK -import kotlin.jvm.* +package foo class WithNative { companion object { @@ -30,4 +30,4 @@ fun box(): String { if (e.message != "foo.ObjWithNative.bar(JLjava/lang/String;)D") return "Fail 2: " + e.message } return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/topLevel.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/topLevel.kt index baeb07dd825..22ac5fe9751 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/native/topLevel.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/native/topLevel.kt @@ -1,6 +1,6 @@ -package foo +// FULL_JDK -import kotlin.jvm.* +package foo external fun bar(l: Long, s: String): Double @@ -16,4 +16,4 @@ fun box(): String { } return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/platformTypeAssertionStackTrace.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/platformTypeAssertionStackTrace.kt index 8d2fa367922..5f55e5a2f3d 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/platformTypeAssertionStackTrace.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/platformTypeAssertionStackTrace.kt @@ -1,3 +1,5 @@ +// FULL_JDK + import java.util.* fun box(): String { diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/collections.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/collections.kt index 1f05c73bb40..0ddaf043e25 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/collections.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/collections.kt @@ -1,3 +1,5 @@ +// FULL_JDK + package collections import kotlin.test.assertEquals diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt1202.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt1202.kt index 149c87a9a78..2a9cfc7ff07 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt1202.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt1202.kt @@ -1,3 +1,5 @@ +// FULL_JDK + package testeval import java.util.* diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt1406.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt1406.kt index b790da5c923..898bd1b3f1e 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt1406.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt1406.kt @@ -1,3 +1,5 @@ +// FULL_JDK + package pack import java.util.ArrayList diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt1770.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt1770.kt index db7ca78eb28..6e97562e809 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt1770.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt1770.kt @@ -1,3 +1,5 @@ +// FULL_JDK + import org.w3c.dom.Element import org.xml.sax.InputSource import javax.xml.parsers.DocumentBuilderFactory @@ -14,4 +16,4 @@ fun box() : String { val doc = builder.parse(source)!!; val myElement = MyElement(doc.getDocumentElement()!!) return myElement.getTagName()!! -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt274.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt274.kt index 448002bf1dd..3d534c6dde2 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt274.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt274.kt @@ -1,4 +1,4 @@ -import kotlin.* +// FULL_JDK fun box() : String { val vector = java.util.Vector() diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt528.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt528.kt index cb8c7c5b6cc..905593cdc08 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt528.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt528.kt @@ -1,3 +1,5 @@ +// FULL_JDK + package mask import java.io.* diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt529.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt529.kt index 39caa24cb9b..68a5f0a762a 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt529.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt529.kt @@ -1,3 +1,5 @@ +// FULL_JDK + package mask import java.io.* diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt533.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt533.kt index c36ac6cbcf2..17bebda5876 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt533.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt533.kt @@ -1,3 +1,5 @@ +// FULL_JDK + package mask import java.io.* diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt6485.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt6485.kt index 4b50b92c821..ec2964694bf 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt6485.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt6485.kt @@ -1,3 +1,5 @@ +// FULL_JDK + import kotlin.test.assertEquals import java.lang.reflect.ParameterizedType import java.lang.reflect.Type diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt864.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt864.kt index d680691ee66..87d7875c148 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt864.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/regressions/kt864.kt @@ -1,3 +1,5 @@ +// FULL_JDK + import java.io.* import java.util.* diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/smap/chainCalls.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/smap/chainCalls.kt index ee3d93c8bb7..522f86e238c 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/smap/chainCalls.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/smap/chainCalls.kt @@ -1,3 +1,5 @@ +// FULL_JDK + fun testProperLineNumber(): String { var exceptionCount = 0; try { @@ -9,7 +11,7 @@ fun testProperLineNumber(): String { catch(e: AssertionError) { val entry = (e as java.lang.Throwable).getStackTrace()!!.get(1) val actual = "${entry.getFileName()}:${entry.getLineNumber()}" - if ("chainCalls.kt:6" != actual) { + if ("chainCalls.kt:8" != actual) { return "fail 1: ${actual}" } exceptionCount++ @@ -23,7 +25,7 @@ fun testProperLineNumber(): String { catch(e: AssertionError) { val entry = e.stackTrace!![1] val actual = "${entry.getFileName()}:${entry.getLineNumber()}" - if ("chainCalls.kt:21" != actual) { + if ("chainCalls.kt:23" != actual) { return "fail 2: ${actual}" } exceptionCount++ @@ -36,7 +38,7 @@ fun testProperLineNumber(): String { catch(e: AssertionError) { val entry = e.stackTrace!![1] val actual = "${entry.getFileName()}:${entry.getLineNumber()}" - if ("chainCalls.kt:34" != actual) { + if ("chainCalls.kt:36" != actual) { return "fail 3: ${actual}" } exceptionCount++ @@ -48,7 +50,7 @@ fun testProperLineNumber(): String { catch(e: AssertionError) { val entry = e.stackTrace!![1] val actual = "${entry.getFileName()}:${entry.getLineNumber()}" - if ("chainCalls.kt:46" != actual) { + if ("chainCalls.kt:48" != actual) { return "fail 4: ${actual}" } exceptionCount++ @@ -79,4 +81,4 @@ fun String.fail(): String { fun call(): String { return "xxx" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/smap/infixCalls.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/smap/infixCalls.kt index 3f2920d5a41..51a118f6761 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/smap/infixCalls.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/smap/infixCalls.kt @@ -1,3 +1,5 @@ +// FULL_JDK + fun testProperLineNumber(): String { var exceptionCount = 0; try { @@ -7,7 +9,7 @@ fun testProperLineNumber(): String { catch(e: AssertionError) { val entry = (e as java.lang.Throwable).getStackTrace()!!.get(1) val actual = "${entry.getFileName()}:${entry.getLineNumber()}" - if ("infixCalls.kt:4" != actual) { + if ("infixCalls.kt:6" != actual) { return "fail 1: ${actual}" } exceptionCount++ @@ -20,7 +22,7 @@ fun testProperLineNumber(): String { catch(e: AssertionError) { val entry = e.stackTrace!![1] val actual = "${entry.getFileName()}:${entry.getLineNumber()}" - if ("infixCalls.kt:17" != actual) { + if ("infixCalls.kt:19" != actual) { return "fail 1: ${actual}" } exceptionCount++ @@ -32,7 +34,7 @@ fun testProperLineNumber(): String { catch(e: AssertionError) { val entry = e.stackTrace!![1] val actual = "${entry.getFileName()}:${entry.getLineNumber()}" - if ("infixCalls.kt:30" != actual) { + if ("infixCalls.kt:32" != actual) { return "fail 1: ${actual}" } exceptionCount++ @@ -59,4 +61,4 @@ infix fun String.fail(p: String): String { fun call(): String { return "xxx" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/smap/simpleCallWithParams.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/smap/simpleCallWithParams.kt index 6459b43a5b4..ba2114b59b2 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/smap/simpleCallWithParams.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/smap/simpleCallWithParams.kt @@ -1,3 +1,5 @@ +// FULL_JDK + fun testProperLineNumberAfterInline(): String { var exceptionCount = 0; try { @@ -7,7 +9,7 @@ fun testProperLineNumberAfterInline(): String { catch(e: AssertionError) { val entry = (e as java.lang.Throwable).getStackTrace()!!.get(1) val actual = "${entry.getFileName()}:${entry.getLineNumber()}" - if ("simpleCallWithParams.kt:4" != actual) { + if ("simpleCallWithParams.kt:6" != actual) { return "fail 1: ${actual}" } exceptionCount++ @@ -20,7 +22,7 @@ fun testProperLineNumberAfterInline(): String { catch(e: AssertionError) { val entry = e.stackTrace!![1] val actual = "${entry.getFileName()}:${entry.getLineNumber()}" - if ("simpleCallWithParams.kt:17" != actual) { + if ("simpleCallWithParams.kt:19" != actual) { return "fail 2: ${actual}" } exceptionCount++ @@ -38,7 +40,7 @@ fun testProperLineForOtherParameters(): String { catch(e: AssertionError) { val entry = e.stackTrace!![1] val actual = "${entry.getFileName()}:${entry.getLineNumber()}" - if ("simpleCallWithParams.kt:35" != actual) { + if ("simpleCallWithParams.kt:37" != actual) { return "fail 3: ${actual}" } exceptionCount++ @@ -52,7 +54,7 @@ fun testProperLineForOtherParameters(): String { catch(e: AssertionError) { val entry = e.stackTrace!![1] val actual = "${entry.getFileName()}:${entry.getLineNumber()}" - if ("simpleCallWithParams.kt:49" != actual) { + if ("simpleCallWithParams.kt:51" != actual) { return "fail 4: ${actual}" } exceptionCount++ @@ -64,7 +66,7 @@ fun testProperLineForOtherParameters(): String { catch(e: AssertionError) { val entry = e.stackTrace!![1] val actual = "${entry.getFileName()}:${entry.getLineNumber()}" - if ("simpleCallWithParams.kt:62" != actual) { + if ("simpleCallWithParams.kt:64" != actual) { return "fail 5: ${actual}" } exceptionCount++ @@ -76,7 +78,7 @@ fun testProperLineForOtherParameters(): String { catch(e: AssertionError) { val entry = e.stackTrace!![1] val actual = "${entry.getFileName()}:${entry.getLineNumber()}" - if ("simpleCallWithParams.kt:74" != actual) { + if ("simpleCallWithParams.kt:76" != actual) { return "fail 6: ${actual}" } exceptionCount++ @@ -103,4 +105,4 @@ inline fun test(): String { fun fail(): String { throw AssertionError("fail") -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/changeMonitor.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/changeMonitor.kt index 8af680f664f..fd77e13fd0b 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/changeMonitor.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/changeMonitor.kt @@ -1,3 +1,5 @@ +// FULL_JDK + fun box(): String { var obj0 = "0" as java.lang.Object var obj1 = "1" as java.lang.Object @@ -19,4 +21,4 @@ fun assertThatThreadDoesNotOwnMonitor(obj: java.lang.Object) { catch (e: IllegalMonitorStateException) { // OK } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/finally.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/finally.kt index 56329c8a26c..3a17bcc7fcd 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/finally.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/finally.kt @@ -1,3 +1,5 @@ +// FULL_JDK + fun box(): String { val obj = "" as java.lang.Object @@ -24,4 +26,4 @@ fun assertThatThreadDoesNotOwnMonitor(obj: java.lang.Object) { catch (e: IllegalMonitorStateException) { // OK } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/nonLocalReturn.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/nonLocalReturn.kt index a4338b11aa1..f40a9480654 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/nonLocalReturn.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/nonLocalReturn.kt @@ -1,3 +1,5 @@ +// FULL_JDK + import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit import java.util.concurrent.Executors @@ -174,5 +176,3 @@ fun box(): String { } return "OK" } - - diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/sync.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/sync.kt index 317fa64a53a..513d2ed76e9 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/sync.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/sync.kt @@ -1,3 +1,5 @@ +// FULL_JDK + import java.util.concurrent.* import java.util.concurrent.atomic.* @@ -30,4 +32,4 @@ fun box() : String { } cdl.await() return if(mtref.get() == 100) "OK" else mtref.get().toString() -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/wait.kt b/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/wait.kt index c82a3259fe0..0c75b1c7610 100644 --- a/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/wait.kt +++ b/compiler/testData/codegen/boxWithStdlib/fullJdk/synchronized/wait.kt @@ -1,3 +1,5 @@ +// FULL_JDK + fun box(): String { val obj = "" as java.lang.Object try { @@ -13,4 +15,4 @@ fun box(): String { } return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/genericBackingFieldSignature.kt b/compiler/testData/codegen/boxWithStdlib/reflection/genericSignature/genericBackingFieldSignature.kt similarity index 100% rename from compiler/testData/codegen/boxWithStdlib/fullJdk/genericBackingFieldSignature.kt rename to compiler/testData/codegen/boxWithStdlib/reflection/genericSignature/genericBackingFieldSignature.kt diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/genericMethodSignature.kt b/compiler/testData/codegen/boxWithStdlib/reflection/genericSignature/genericMethodSignature.kt similarity index 100% rename from compiler/testData/codegen/boxWithStdlib/fullJdk/genericMethodSignature.kt rename to compiler/testData/codegen/boxWithStdlib/reflection/genericSignature/genericMethodSignature.kt diff --git a/compiler/testData/codegen/boxWithStdlib/fullJdk/kt2509.kt b/compiler/testData/codegen/boxWithStdlib/regressions/kt2509.kt similarity index 100% rename from compiler/testData/codegen/boxWithStdlib/fullJdk/kt2509.kt rename to compiler/testData/codegen/boxWithStdlib/regressions/kt2509.kt diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxCodegenTest.java b/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxCodegenTest.java index 57ca562f06a..0fcf3391eed 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxCodegenTest.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxCodegenTest.java @@ -72,8 +72,12 @@ public abstract class AbstractBlackBoxCodegenTest extends CodegenTestCase { FilesKt.readText(new File(filename), Charsets.UTF_8), "NO_KOTLIN_REFLECT" ) ? ConfigurationKind.NO_KOTLIN_REFLECT : ConfigurationKind.ALL; + TestJdkKind jdkKind = isFullJdkDirectiveDefined(FilesKt.readText(new File(filename), Charsets.UTF_8)) + ? TestJdkKind.FULL_JDK + : TestJdkKind.MOCK_JDK; + myEnvironment = KotlinTestUtils.createEnvironmentWithJdkAndNullabilityAnnotationsFromIdea( - getTestRootDisposable(), configurationKind, getTestJdkKind(filename) + getTestRootDisposable(), configurationKind, jdkKind ); blackBoxFileByFullPath(filename); @@ -137,17 +141,6 @@ public abstract class AbstractBlackBoxCodegenTest extends CodegenTestCase { return javaFilePaths; } - // NOTE: tests under fullJdk/ are run with FULL_JDK instead of MOCK_JDK - @NotNull - private static TestJdkKind getTestJdkKind(@NotNull String sourcePath) { - if (sourcePath.contains("compiler/testData/codegen/boxWithStdlib/fullJdk")) { - return TestJdkKind.FULL_JDK; - } - - String content = FilesKt.readText(new File(sourcePath), Charsets.UTF_8); - return isFullJdkDirectiveDefined(content) ? TestJdkKind.FULL_JDK : TestJdkKind.MOCK_JDK; - } - private static boolean isFullJdkDirectiveDefined(@NotNull String content) { return InTextDirectivesUtils.isDirectiveDefined(content, "FULL_JDK"); } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxWithStdlibCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxWithStdlibCodegenTestGenerated.java index 7c1fd1b1281..27b99123016 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxWithStdlibCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxWithStdlibCodegenTestGenerated.java @@ -35,21 +35,6 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxWithStdlib"), Pattern.compile("^(.+)\\.kt$"), true); } - @TestMetadata("compiler/testData/codegen/boxWithStdlib/againstMultifileStdlib") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class AgainstMultifileStdlib extends AbstractBlackBoxCodegenTest { - public void testAllFilesPresentInAgainstMultifileStdlib() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxWithStdlib/againstMultifileStdlib"), Pattern.compile("^(.+)\\.kt$"), true); - } - - @TestMetadata("useStdlib.kt") - public void testUseStdlib() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/againstMultifileStdlib/useStdlib.kt"); - doTestWithStdlib(fileName); - } - } - @TestMetadata("compiler/testData/codegen/boxWithStdlib/annotations") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -1693,18 +1678,6 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode doTestWithStdlib(fileName); } - @TestMetadata("genericBackingFieldSignature.kt") - public void testGenericBackingFieldSignature() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/fullJdk/genericBackingFieldSignature.kt"); - doTestWithStdlib(fileName); - } - - @TestMetadata("genericMethodSignature.kt") - public void testGenericMethodSignature() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/fullJdk/genericMethodSignature.kt"); - doTestWithStdlib(fileName); - } - @TestMetadata("ifInWhile.kt") public void testIfInWhile() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/fullJdk/ifInWhile.kt"); @@ -1729,12 +1702,6 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode doTestWithStdlib(fileName); } - @TestMetadata("kt2509.kt") - public void testKt2509() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/fullJdk/kt2509.kt"); - doTestWithStdlib(fileName); - } - @TestMetadata("kt434.kt") public void testKt434() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/fullJdk/kt434.kt"); @@ -3825,6 +3792,18 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode doTestWithStdlib(fileName); } + @TestMetadata("genericBackingFieldSignature.kt") + public void testGenericBackingFieldSignature() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/genericSignature/genericBackingFieldSignature.kt"); + doTestWithStdlib(fileName); + } + + @TestMetadata("genericMethodSignature.kt") + public void testGenericMethodSignature() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/genericSignature/genericMethodSignature.kt"); + doTestWithStdlib(fileName); + } + @TestMetadata("kt5112.kt") public void testKt5112() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/genericSignature/kt5112.kt"); @@ -4537,6 +4516,12 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode doTestWithStdlib(fileName); } + @TestMetadata("kt2509.kt") + public void testKt2509() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/regressions/kt2509.kt"); + doTestWithStdlib(fileName); + } + @TestMetadata("kt2593.kt") public void testKt2593() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/regressions/kt2593.kt");