[Test] Migrate tests for java 15 to regular test infrastructure
This commit is contained in:
committed by
teamcityserver
parent
4f73ebbcbd
commit
c168a561df
+80
@@ -41679,6 +41679,86 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/testsWithJava15")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class TestsWithJava15 {
|
||||
@Test
|
||||
public void testAllFilesPresentInTestsWithJava15() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/testsWithJava15"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/testsWithJava15/records")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Records {
|
||||
@Test
|
||||
public void testAllFilesPresentInRecords() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/testsWithJava15/records"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("bytecodeShapeForJava.kt")
|
||||
public void testBytecodeShapeForJava() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/bytecodeShapeForJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("collectionSizeOverrides.kt")
|
||||
public void testCollectionSizeOverrides() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/collectionSizeOverrides.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("dataJvmRecord.kt")
|
||||
public void testDataJvmRecord() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/dataJvmRecord.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jvmRecordBinary.kt")
|
||||
public void testJvmRecordBinary() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/jvmRecordBinary.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertiesOverrides.kt")
|
||||
public void testPropertiesOverrides() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/propertiesOverrides.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertiesOverridesAllCompatibilityJvmDefault.kt")
|
||||
public void testPropertiesOverridesAllCompatibilityJvmDefault() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/propertiesOverridesAllCompatibilityJvmDefault.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertiesOverridesEnableJvmDefault.kt")
|
||||
public void testPropertiesOverridesEnableJvmDefault() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/propertiesOverridesEnableJvmDefault.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("recordDifferentPropertyOverride.kt")
|
||||
public void testRecordDifferentPropertyOverride() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/recordDifferentPropertyOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("recordDifferentSyntheticProperty.kt")
|
||||
public void testRecordDifferentSyntheticProperty() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/recordDifferentSyntheticProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("recordPropertyAccess.kt")
|
||||
public void testRecordPropertyAccess() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/recordPropertyAccess.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/testsWithJava9")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+5
-5
@@ -2,16 +2,16 @@
|
||||
// !LANGUAGE: +JvmRecordSupport
|
||||
// JVM_TARGET: 15
|
||||
// ENABLE_JVM_PREVIEW
|
||||
|
||||
// MODULE: lib
|
||||
// FILE: A.kt
|
||||
@JvmRecord
|
||||
data class MyRecord(val foo: String, val bar: String)
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: B.kt
|
||||
|
||||
fun main() {
|
||||
fun box(): String {
|
||||
val myRecord = MyRecord("O", "K")
|
||||
val s = myRecord.foo + myRecord.bar
|
||||
if (s != "OK") {
|
||||
throw AssertionError("fail: $s")
|
||||
}
|
||||
return myRecord.foo + myRecord.bar
|
||||
}
|
||||
+80
@@ -41523,6 +41523,86 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/testsWithJava15")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class TestsWithJava15 {
|
||||
@Test
|
||||
public void testAllFilesPresentInTestsWithJava15() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/testsWithJava15"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/testsWithJava15/records")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Records {
|
||||
@Test
|
||||
public void testAllFilesPresentInRecords() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/testsWithJava15/records"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("bytecodeShapeForJava.kt")
|
||||
public void testBytecodeShapeForJava() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/bytecodeShapeForJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("collectionSizeOverrides.kt")
|
||||
public void testCollectionSizeOverrides() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/collectionSizeOverrides.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("dataJvmRecord.kt")
|
||||
public void testDataJvmRecord() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/dataJvmRecord.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jvmRecordBinary.kt")
|
||||
public void testJvmRecordBinary() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/jvmRecordBinary.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertiesOverrides.kt")
|
||||
public void testPropertiesOverrides() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/propertiesOverrides.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertiesOverridesAllCompatibilityJvmDefault.kt")
|
||||
public void testPropertiesOverridesAllCompatibilityJvmDefault() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/propertiesOverridesAllCompatibilityJvmDefault.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertiesOverridesEnableJvmDefault.kt")
|
||||
public void testPropertiesOverridesEnableJvmDefault() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/propertiesOverridesEnableJvmDefault.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("recordDifferentPropertyOverride.kt")
|
||||
public void testRecordDifferentPropertyOverride() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/recordDifferentPropertyOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("recordDifferentSyntheticProperty.kt")
|
||||
public void testRecordDifferentSyntheticProperty() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/recordDifferentSyntheticProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("recordPropertyAccess.kt")
|
||||
public void testRecordPropertyAccess() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/recordPropertyAccess.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/testsWithJava9")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+80
@@ -41679,6 +41679,86 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/testsWithJava15")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class TestsWithJava15 {
|
||||
@Test
|
||||
public void testAllFilesPresentInTestsWithJava15() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/testsWithJava15"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/testsWithJava15/records")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Records {
|
||||
@Test
|
||||
public void testAllFilesPresentInRecords() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/testsWithJava15/records"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("bytecodeShapeForJava.kt")
|
||||
public void testBytecodeShapeForJava() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/bytecodeShapeForJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("collectionSizeOverrides.kt")
|
||||
public void testCollectionSizeOverrides() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/collectionSizeOverrides.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("dataJvmRecord.kt")
|
||||
public void testDataJvmRecord() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/dataJvmRecord.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jvmRecordBinary.kt")
|
||||
public void testJvmRecordBinary() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/jvmRecordBinary.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertiesOverrides.kt")
|
||||
public void testPropertiesOverrides() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/propertiesOverrides.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertiesOverridesAllCompatibilityJvmDefault.kt")
|
||||
public void testPropertiesOverridesAllCompatibilityJvmDefault() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/propertiesOverridesAllCompatibilityJvmDefault.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertiesOverridesEnableJvmDefault.kt")
|
||||
public void testPropertiesOverridesEnableJvmDefault() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/propertiesOverridesEnableJvmDefault.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("recordDifferentPropertyOverride.kt")
|
||||
public void testRecordDifferentPropertyOverride() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/recordDifferentPropertyOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("recordDifferentSyntheticProperty.kt")
|
||||
public void testRecordDifferentSyntheticProperty() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/recordDifferentSyntheticProperty.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("recordPropertyAccess.kt")
|
||||
public void testRecordPropertyAccess() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/testsWithJava15/records/recordPropertyAccess.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/testsWithJava9")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ class JavaCompilerFacade(private val testServices: TestServices) {
|
||||
}
|
||||
|
||||
private fun compileJavaFiles(module: TestModule, jvmTarget: JvmTarget, files: List<File>, javacOptions: List<String>, ignoreErrors: Boolean) {
|
||||
val targetIsJava8OrLower = System.getProperty("java.version").startsWith("1.")
|
||||
val targetIsJava8OrLower = System.getProperty("java.version").startsWith("1.") && jvmTarget <= JvmTarget.JVM_1_6
|
||||
if (USE_JAVAC_BASED_ON_JVM_TARGET !in module.directives || targetIsJava8OrLower) {
|
||||
org.jetbrains.kotlin.test.compileJavaFiles(
|
||||
files,
|
||||
|
||||
+4
-2
@@ -15,6 +15,7 @@ import org.jetbrains.kotlin.test.TestJdkKind
|
||||
import org.jetbrains.kotlin.test.clientserver.TestProxy
|
||||
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives
|
||||
import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.JDK_KIND
|
||||
import org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives.ENABLE_JVM_PREVIEW
|
||||
import org.jetbrains.kotlin.test.directives.model.singleOrZeroValue
|
||||
import org.jetbrains.kotlin.test.model.BinaryArtifacts
|
||||
import org.jetbrains.kotlin.test.model.DependencyKind
|
||||
@@ -199,14 +200,15 @@ class JvmBoxRunner(testServices: TestServices) : JvmBinaryArtifactHandler(testSe
|
||||
"${mainFile.nameWithoutExtension}Kt"
|
||||
).joinToString(".")
|
||||
|
||||
val command = arrayOf(
|
||||
val command = listOfNotNull(
|
||||
javaExe.absolutePath,
|
||||
"-ea",
|
||||
runIf(ENABLE_JVM_PREVIEW in module.directives) { "--enable-preview" },
|
||||
"-classpath",
|
||||
classPath.joinToString(File.pathSeparator, transform = { File(it.toURI()).absolutePath }),
|
||||
mainFqName,
|
||||
)
|
||||
val process = ProcessBuilder(*command).inheritIO().start()
|
||||
val process = ProcessBuilder(command).inheritIO().start()
|
||||
process.waitFor(1, TimeUnit.MINUTES)
|
||||
process.outputStream.flush()
|
||||
return when (process.exitValue()) {
|
||||
|
||||
+17
-4
@@ -13,6 +13,9 @@ import org.jetbrains.kotlin.test.backend.handlers.BytecodeListingHandler
|
||||
import org.jetbrains.kotlin.test.backend.handlers.BytecodeTextHandler
|
||||
import org.jetbrains.kotlin.test.bind
|
||||
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
|
||||
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives
|
||||
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.IGNORE_DEXING
|
||||
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.USE_JAVAC_BASED_ON_JVM_TARGET
|
||||
import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives.DIAGNOSTICS
|
||||
import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives.REPORT_ONLY_EXPLICITLY_DEFINED_DEBUG_INFO
|
||||
import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.JDK_KIND
|
||||
@@ -53,12 +56,22 @@ abstract class AbstractJvmBlackBoxCodegenTestBase<R : ResultingArtifact.Frontend
|
||||
}
|
||||
|
||||
forTestsMatching("compiler/testData/codegen/box/testsWithJava9/*") {
|
||||
defaultDirectives {
|
||||
JDK_KIND with TestJdkKind.FULL_JDK_9
|
||||
+WITH_STDLIB
|
||||
}
|
||||
configureModernJavaTest(TestJdkKind.FULL_JDK_9)
|
||||
}
|
||||
|
||||
forTestsMatching("compiler/testData/codegen/box/testsWithJava15/*") {
|
||||
configureModernJavaTest(TestJdkKind.FULL_JDK_15)
|
||||
}
|
||||
|
||||
enableMetaInfoHandler()
|
||||
}
|
||||
|
||||
private fun TestConfigurationBuilder.configureModernJavaTest(jdkKind: TestJdkKind) {
|
||||
defaultDirectives {
|
||||
JDK_KIND with jdkKind
|
||||
+WITH_STDLIB
|
||||
+USE_JAVAC_BASED_ON_JVM_TARGET
|
||||
+IGNORE_DEXING
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-27
@@ -1,27 +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.codegen
|
||||
|
||||
import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime
|
||||
import org.jetbrains.kotlin.test.TestJdkKind
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil
|
||||
|
||||
abstract class AbstractCompileKotlinAgainstKotlinJdk15Test : AbstractCompileKotlinAgainstKotlinTest() {
|
||||
override fun invokeBox(className: String) {
|
||||
runJvmInstance(
|
||||
KtTestUtil.getJdk15Home(),
|
||||
additionalArgs = listOf("--enable-preview"),
|
||||
classPath = listOfNotNull(
|
||||
aDir, bDir, ForTestCompileRuntime.runtimeJarForTests(),
|
||||
),
|
||||
className
|
||||
)
|
||||
}
|
||||
|
||||
override fun getTestJdkKind(files: List<TestFile>): TestJdkKind {
|
||||
return TestJdkKind.FULL_JDK_15
|
||||
}
|
||||
}
|
||||
-55
@@ -15,61 +15,6 @@ import org.jetbrains.kotlin.test.util.KtTestUtil
|
||||
import java.io.File
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
@OptIn(ObsoleteTestInfrastructure::class)
|
||||
abstract class AbstractCustomJDKBlackBoxCodegenTest : AbstractBlackBoxCodegenTest() {
|
||||
@Throws(Exception::class)
|
||||
override fun doTest(filePath: String) {
|
||||
val file = File(filePath)
|
||||
val expectedText =
|
||||
KtTestUtil.doLoadFile(file) +
|
||||
"\n" +
|
||||
"""
|
||||
fun main() {
|
||||
val res = box()
|
||||
if (res != "OK") throw AssertionError(res)
|
||||
}
|
||||
""".trimIndent()
|
||||
val testFiles = createTestFilesFromFile(file, expectedText)
|
||||
doMultiFileTest(file, testFiles)
|
||||
}
|
||||
|
||||
override fun extractConfigurationKind(files: List<TestFile>): ConfigurationKind {
|
||||
return ConfigurationKind.NO_KOTLIN_REFLECT
|
||||
}
|
||||
|
||||
override fun runJavacTask(files: MutableCollection<File>, options: List<String>) {
|
||||
assert(KotlinTestUtils.compileJavaFilesExternally(files, options, getJdkHome())) {
|
||||
"Javac failed: $options on $files"
|
||||
}
|
||||
}
|
||||
|
||||
override fun getTestJdkKind(files: List<TestFile>): TestJdkKind {
|
||||
return getTestJdkKind()
|
||||
}
|
||||
|
||||
abstract fun getTestJdkKind(): TestJdkKind
|
||||
abstract fun getJdkHome(): File
|
||||
|
||||
open fun getAdditionalJvmArgs(): List<String> = emptyList()
|
||||
|
||||
abstract override fun getPrefix(): String
|
||||
|
||||
override fun blackBox(reportProblems: Boolean, unexpectedBehaviour: Boolean) {
|
||||
val tmpdir = KotlinTestUtils.tmpDirForTest(this)
|
||||
val fileFactory = generateClassesInFile()
|
||||
fileFactory.writeAll(tmpdir, null)
|
||||
|
||||
runJvmInstance(
|
||||
getJdkHome(), getAdditionalJvmArgs(),
|
||||
classPath = listOfNotNull(
|
||||
tmpdir, ForTestCompileRuntime.runtimeJarForTests(),
|
||||
javaClassesOutputDirectory
|
||||
),
|
||||
classNameToRun = getFacadeFqName(myFiles.psiFile)!!
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ObsoleteTestInfrastructure::class)
|
||||
internal fun runJvmInstance(
|
||||
jdkHome: File,
|
||||
|
||||
-18
@@ -1,18 +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.codegen
|
||||
|
||||
import org.jetbrains.kotlin.test.TargetBackend
|
||||
|
||||
abstract class AbstractIrCompileKotlinAgainstKotlinJdk15Test : AbstractCompileKotlinAgainstKotlinJdk15Test() {
|
||||
override fun getBackendA(): TargetBackend {
|
||||
return TargetBackend.JVM_IR
|
||||
}
|
||||
|
||||
override fun getBackendB(): TargetBackend {
|
||||
return TargetBackend.JVM_IR
|
||||
}
|
||||
}
|
||||
-20
@@ -1,20 +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.codegen
|
||||
|
||||
import org.jetbrains.kotlin.test.TestJdkKind
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil
|
||||
import java.io.File
|
||||
|
||||
abstract class AbstractJdk15BlackBoxCodegenTest : AbstractCustomJDKBlackBoxCodegenTest() {
|
||||
override fun getTestJdkKind(): TestJdkKind = TestJdkKind.FULL_JDK_15
|
||||
override fun getJdkHome(): File = KtTestUtil.getJdk15Home()
|
||||
override fun getPrefix(): String = "java15/box"
|
||||
|
||||
override fun getAdditionalJvmArgs(): List<String> = listOf("--enable-preview")
|
||||
|
||||
override fun verifyWithDex(): Boolean = false
|
||||
}
|
||||
-13
@@ -1,13 +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.codegen
|
||||
|
||||
import org.jetbrains.kotlin.test.TargetBackend
|
||||
|
||||
abstract class AbstractJdk15IrBlackBoxCodegenTest : AbstractJdk15BlackBoxCodegenTest() {
|
||||
override val backend: TargetBackend
|
||||
get() = TargetBackend.JVM_IR
|
||||
}
|
||||
-16
@@ -110,14 +110,6 @@ fun generateJUnit3CompilerTests(args: Array<String>) {
|
||||
model("codegen/asmLike", targetBackend = TargetBackend.JVM)
|
||||
}
|
||||
|
||||
testClass<AbstractJdk15BlackBoxCodegenTest> {
|
||||
model("codegen/java15/box")
|
||||
}
|
||||
|
||||
testClass<AbstractJdk15IrBlackBoxCodegenTest> {
|
||||
model("codegen/java15/box", targetBackend = TargetBackend.JVM_IR)
|
||||
}
|
||||
|
||||
testClass<AbstractScriptCodegenTest> {
|
||||
model("codegen/script", extension = "kts")
|
||||
}
|
||||
@@ -253,14 +245,6 @@ fun generateJUnit3CompilerTests(args: Array<String>) {
|
||||
)
|
||||
}
|
||||
|
||||
testClass<AbstractCompileKotlinAgainstKotlinJdk15Test> {
|
||||
model("compileKotlinAgainstKotlinJdk15")
|
||||
}
|
||||
|
||||
testClass<AbstractIrCompileKotlinAgainstKotlinJdk15Test> {
|
||||
model("compileKotlinAgainstKotlinJdk15", targetBackend = TargetBackend.JVM_IR)
|
||||
}
|
||||
|
||||
testClass<AbstractModuleXmlParserTest> {
|
||||
model("modules.xml", extension = "xml")
|
||||
}
|
||||
|
||||
Generated
-36
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2021 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.codegen;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("compiler/testData/compileKotlinAgainstKotlinJdk15")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class CompileKotlinAgainstKotlinJdk15TestGenerated extends AbstractCompileKotlinAgainstKotlinJdk15Test {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInCompileKotlinAgainstKotlinJdk15() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileKotlinAgainstKotlinJdk15"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@TestMetadata("jvmRecordBinary.kt")
|
||||
public void testJvmRecordBinary() throws Exception {
|
||||
runTest("compiler/testData/compileKotlinAgainstKotlinJdk15/jvmRecordBinary.kt");
|
||||
}
|
||||
}
|
||||
Generated
-37
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2021 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.codegen;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
import org.jetbrains.kotlin.test.TargetBackend;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("compiler/testData/compileKotlinAgainstKotlinJdk15")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class IrCompileKotlinAgainstKotlinJdk15TestGenerated extends AbstractIrCompileKotlinAgainstKotlinJdk15Test {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInCompileKotlinAgainstKotlinJdk15() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileKotlinAgainstKotlinJdk15"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("jvmRecordBinary.kt")
|
||||
public void testJvmRecordBinary() throws Exception {
|
||||
runTest("compiler/testData/compileKotlinAgainstKotlinJdk15/jvmRecordBinary.kt");
|
||||
}
|
||||
}
|
||||
-89
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2021 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.codegen;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("compiler/testData/codegen/java15/box")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class Jdk15BlackBoxCodegenTestGenerated extends AbstractJdk15BlackBoxCodegenTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInBox() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/java15/box"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/java15/box/records")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Records extends AbstractJdk15BlackBoxCodegenTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInRecords() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/java15/box/records"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@TestMetadata("bytecodeShapeForJava.kt")
|
||||
public void testBytecodeShapeForJava() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/bytecodeShapeForJava.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("collectionSizeOverrides.kt")
|
||||
public void testCollectionSizeOverrides() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/collectionSizeOverrides.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("dataJvmRecord.kt")
|
||||
public void testDataJvmRecord() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/dataJvmRecord.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertiesOverrides.kt")
|
||||
public void testPropertiesOverrides() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/propertiesOverrides.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertiesOverridesAllCompatibilityJvmDefault.kt")
|
||||
public void testPropertiesOverridesAllCompatibilityJvmDefault() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/propertiesOverridesAllCompatibilityJvmDefault.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertiesOverridesEnableJvmDefault.kt")
|
||||
public void testPropertiesOverridesEnableJvmDefault() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/propertiesOverridesEnableJvmDefault.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("recordDifferentPropertyOverride.kt")
|
||||
public void testRecordDifferentPropertyOverride() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/recordDifferentPropertyOverride.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("recordDifferentSyntheticProperty.kt")
|
||||
public void testRecordDifferentSyntheticProperty() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/recordDifferentSyntheticProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("recordPropertyAccess.kt")
|
||||
public void testRecordPropertyAccess() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/recordPropertyAccess.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
-90
@@ -1,90 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2021 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.codegen;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
import org.jetbrains.kotlin.test.TargetBackend;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("compiler/testData/codegen/java15/box")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class Jdk15IrBlackBoxCodegenTestGenerated extends AbstractJdk15IrBlackBoxCodegenTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInBox() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/java15/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/codegen/java15/box/records")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Records extends AbstractJdk15IrBlackBoxCodegenTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInRecords() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/java15/box/records"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("bytecodeShapeForJava.kt")
|
||||
public void testBytecodeShapeForJava() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/bytecodeShapeForJava.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("collectionSizeOverrides.kt")
|
||||
public void testCollectionSizeOverrides() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/collectionSizeOverrides.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("dataJvmRecord.kt")
|
||||
public void testDataJvmRecord() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/dataJvmRecord.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertiesOverrides.kt")
|
||||
public void testPropertiesOverrides() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/propertiesOverrides.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertiesOverridesAllCompatibilityJvmDefault.kt")
|
||||
public void testPropertiesOverridesAllCompatibilityJvmDefault() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/propertiesOverridesAllCompatibilityJvmDefault.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertiesOverridesEnableJvmDefault.kt")
|
||||
public void testPropertiesOverridesEnableJvmDefault() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/propertiesOverridesEnableJvmDefault.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("recordDifferentPropertyOverride.kt")
|
||||
public void testRecordDifferentPropertyOverride() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/recordDifferentPropertyOverride.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("recordDifferentSyntheticProperty.kt")
|
||||
public void testRecordDifferentSyntheticProperty() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/recordDifferentSyntheticProperty.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("recordPropertyAccess.kt")
|
||||
public void testRecordPropertyAccess() throws Exception {
|
||||
runTest("compiler/testData/codegen/java15/box/records/recordPropertyAccess.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user