[Test] Migrate Parcelize tests to new test infrastructure
This commit is contained in:
committed by
TeamCityServer
parent
a68c4ec7be
commit
df47bffabb
@@ -28,13 +28,14 @@ import org.jetbrains.kotlin.kapt3.test.AbstractIrKotlinKaptContextTest
|
||||
import org.jetbrains.kotlin.kapt3.test.AbstractKotlinKaptContextTest
|
||||
import org.jetbrains.kotlin.lombok.AbstractLombokCompileTest
|
||||
import org.jetbrains.kotlin.noarg.*
|
||||
import org.jetbrains.kotlin.parcelize.test.AbstractParcelizeBoxTest
|
||||
import org.jetbrains.kotlin.parcelize.test.AbstractParcelizeBytecodeListingTest
|
||||
import org.jetbrains.kotlin.parcelize.test.AbstractParcelizeIrBoxTest
|
||||
import org.jetbrains.kotlin.parcelize.test.AbstractParcelizeIrBytecodeListingTest
|
||||
import org.jetbrains.kotlin.parcelize.test.runners.AbstractParcelizeBoxTest
|
||||
import org.jetbrains.kotlin.parcelize.test.runners.AbstractParcelizeBytecodeListingTest
|
||||
import org.jetbrains.kotlin.parcelize.test.runners.AbstractParcelizeIrBoxTest
|
||||
import org.jetbrains.kotlin.parcelize.test.runners.AbstractParcelizeIrBytecodeListingTest
|
||||
import org.jetbrains.kotlin.samWithReceiver.AbstractSamWithReceiverScriptTest
|
||||
import org.jetbrains.kotlin.samWithReceiver.AbstractSamWithReceiverTest
|
||||
import org.jetbrains.kotlin.test.TargetBackend
|
||||
import org.jetbrains.kotlin.test.generators.generateTestGroupSuiteWithJUnit5
|
||||
import org.jetbrains.kotlinx.serialization.AbstractSerializationIrBytecodeListingTest
|
||||
import org.jetbrains.kotlinx.serialization.AbstractSerializationPluginBytecodeListingTest
|
||||
import org.jetbrains.kotlinx.serialization.AbstractSerializationPluginDiagnosticTest
|
||||
@@ -147,24 +148,6 @@ fun main(args: Array<String>) {
|
||||
}
|
||||
}
|
||||
|
||||
testGroup("plugins/parcelize/parcelize-compiler/tests-gen", "plugins/parcelize/parcelize-compiler/testData") {
|
||||
testClass<AbstractParcelizeBoxTest> {
|
||||
model("box", targetBackend = TargetBackend.JVM)
|
||||
}
|
||||
|
||||
testClass<AbstractParcelizeIrBoxTest> {
|
||||
model("box", targetBackend = TargetBackend.JVM_IR)
|
||||
}
|
||||
|
||||
testClass<AbstractParcelizeBytecodeListingTest> {
|
||||
model("codegen", targetBackend = TargetBackend.JVM)
|
||||
}
|
||||
|
||||
testClass<AbstractParcelizeIrBytecodeListingTest> {
|
||||
model("codegen", targetBackend = TargetBackend.JVM_IR)
|
||||
}
|
||||
}
|
||||
|
||||
testGroup("plugins/jvm-abi-gen/test", "plugins/jvm-abi-gen/testData") {
|
||||
testClass<AbstractCompareJvmAbiTest> {
|
||||
model("compare", recursive = false, extension = null, targetBackend = TargetBackend.JVM)
|
||||
@@ -372,4 +355,24 @@ fun main(args: Array<String>) {
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
generateTestGroupSuiteWithJUnit5 {
|
||||
testGroup("plugins/parcelize/parcelize-compiler/tests-gen", "plugins/parcelize/parcelize-compiler/testData") {
|
||||
testClass<AbstractParcelizeBoxTest> {
|
||||
model("box")
|
||||
}
|
||||
|
||||
testClass<AbstractParcelizeIrBoxTest> {
|
||||
model("box")
|
||||
}
|
||||
|
||||
testClass<AbstractParcelizeBytecodeListingTest> {
|
||||
model("codegen")
|
||||
}
|
||||
|
||||
testClass<AbstractParcelizeIrBytecodeListingTest> {
|
||||
model("codegen")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ dependencies {
|
||||
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
||||
compileOnly(intellijDep()) { includeJars("asm-all", rootProject = rootProject) }
|
||||
|
||||
testApiJUnit5()
|
||||
|
||||
testApi(project(":compiler:util"))
|
||||
testApi(project(":compiler:backend"))
|
||||
testApi(project(":compiler:ir.backend.common"))
|
||||
@@ -31,8 +33,12 @@ dependencies {
|
||||
testApi(project(":compiler:cli"))
|
||||
testApi(project(":plugins:parcelize:parcelize-runtime"))
|
||||
testApi(project(":kotlin-android-extensions-runtime"))
|
||||
testApi(projectTests(":compiler:tests-common"))
|
||||
testApi(project(":kotlin-test:kotlin-test-jvm"))
|
||||
|
||||
testApi(projectTests(":compiler:tests-common-new"))
|
||||
testApi(projectTests(":compiler:test-infrastructure"))
|
||||
testApi(projectTests(":compiler:test-infrastructure-utils"))
|
||||
|
||||
testApi(commonDep("junit:junit"))
|
||||
|
||||
testRuntimeOnly(intellijPluginDep("junit"))
|
||||
@@ -69,7 +75,8 @@ sourcesJar()
|
||||
|
||||
testsJar()
|
||||
|
||||
projectTest {
|
||||
projectTest(jUnit5Enabled = true) {
|
||||
useJUnitPlatform()
|
||||
dependsOn(parcelizeRuntimeForTests)
|
||||
dependsOn(":dist")
|
||||
workingDir = rootDir
|
||||
@@ -84,4 +91,9 @@ projectTest {
|
||||
systemProperty("parcelizeRuntime.classpath", parcelizeRuntimeForTestsProvider.get())
|
||||
systemProperty("robolectric.classpath", robolectricClasspathProvider.get())
|
||||
}
|
||||
doLast {
|
||||
println(filter)
|
||||
println(filter.excludePatterns)
|
||||
println(filter.includePatterns)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT writeToParcel, createFromParcel
|
||||
// CURIOUS_ABOUT: writeToParcel, createFromParcel
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlinx.parcelize.*
|
||||
@@ -14,4 +14,4 @@ class User(
|
||||
val binderArrayList: ArrayList<IBinder> // should be serialized using our strategy, not using Parcel.writeBinderList()
|
||||
// There is no readStrongInterface method in Parcel.
|
||||
// val intf: IInterface?
|
||||
) : Parcelable
|
||||
) : Parcelable
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT writeToParcel, createFromParcel
|
||||
// CURIOUS_ABOUT: writeToParcel, createFromParcel
|
||||
// WITH_RUNTIME
|
||||
|
||||
// Test to ensure that we are using the correct class loader
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT describeContents
|
||||
// CURIOUS_ABOUT: describeContents
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlinx.parcelize.*
|
||||
@@ -7,4 +7,4 @@ import android.os.Parcelable
|
||||
@Parcelize
|
||||
class User(val firstName: String, val lastName: String, val age: Int, val isProUser: Boolean) : Parcelable {
|
||||
override fun describeContents() = 100
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT writeToParcel, createFromParcel, <clinit>
|
||||
// CURIOUS_ABOUT: writeToParcel, createFromParcel, <clinit>
|
||||
// WITH_RUNTIME
|
||||
|
||||
package test
|
||||
@@ -8,4 +8,4 @@ import android.os.*
|
||||
import android.accounts.Account
|
||||
|
||||
@Parcelize
|
||||
class Foo(val kp: Account): Parcelable
|
||||
class Foo(val kp: Account): Parcelable
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ public final class test/Foo$Creator : java/lang/Object, android/os/Parcelable$Cr
|
||||
|
||||
public java.lang.Object createFromParcel(android.os.Parcel p0) {
|
||||
LABEL (L0)
|
||||
LINENUMBER (9)
|
||||
LINENUMBER (40)
|
||||
ALOAD (0)
|
||||
ALOAD (1)
|
||||
INVOKEVIRTUAL (test/Foo$Creator, createFromParcel, (Landroid/os/Parcel;)Ltest/Foo;)
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT writeToParcel, createFromParcel, <clinit>
|
||||
// CURIOUS_ABOUT: writeToParcel, createFromParcel, <clinit>
|
||||
// WITH_RUNTIME
|
||||
|
||||
// FILE: KotlinParcelable.kt
|
||||
@@ -37,4 +37,4 @@ import android.os.*
|
||||
import k.*
|
||||
|
||||
@Parcelize
|
||||
class Foo(val kp: KotlinParcelable): Parcelable
|
||||
class Foo(val kp: KotlinParcelable): Parcelable
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT writeToParcel, createFromParcel, newArray
|
||||
// CURIOUS_ABOUT: writeToParcel, createFromParcel, newArray
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlinx.parcelize.*
|
||||
@@ -16,4 +16,4 @@ class User(val firstName: String, val lastName: String, val age: Int) : Parcelab
|
||||
|
||||
override fun create(parcel: Parcel) = User(parcel.readString(), parcel.readString(), parcel.readInt())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT newArray
|
||||
// CURIOUS_ABOUT: newArray
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlinx.parcelize.*
|
||||
@@ -18,4 +18,4 @@ class User(val firstName: String, val lastName: String, val age: Int) : Parcelab
|
||||
|
||||
override fun newArray(size: Int) = arrayOfNulls<User>(size) as Array<User>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT describeContents
|
||||
// CURIOUS_ABOUT: describeContents
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlinx.parcelize.*
|
||||
@@ -9,4 +9,4 @@ abstract class AbstractUser : Parcelable {
|
||||
}
|
||||
|
||||
@Parcelize
|
||||
class User(val firstName: String, val lastName: String, val age: Int, val isProUser: Boolean) : AbstractUser()
|
||||
class User(val firstName: String, val lastName: String, val age: Int, val isProUser: Boolean) : AbstractUser()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT <clinit>
|
||||
// CURIOUS_ABOUT: <clinit>
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlinx.parcelize.*
|
||||
@@ -11,4 +11,4 @@ class User(val firstName: String) : Parcelable {
|
||||
@JvmStatic
|
||||
private val test = StringBuilder()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT writeToParcel, createFromParcel, <clinit>
|
||||
// CURIOUS_ABOUT: writeToParcel, createFromParcel, <clinit>
|
||||
// WITH_RUNTIME
|
||||
//FILE: test.kt
|
||||
package test
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT writeToParcel, createFromParcel
|
||||
// CURIOUS_ABOUT: writeToParcel, createFromParcel
|
||||
// RENDER_ANNOTATIONS
|
||||
// WITH_RUNTIME
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT writeToParcel, createFromParcel
|
||||
// CURIOUS_ABOUT: writeToParcel, createFromParcel
|
||||
// WITH_RUNTIME
|
||||
|
||||
package test
|
||||
@@ -7,4 +7,4 @@ import kotlinx.parcelize.*
|
||||
import android.os.Parcelable
|
||||
|
||||
@Parcelize
|
||||
class SomeClass : Parcelable
|
||||
class SomeClass : Parcelable
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// CURIOUS_ABOUT writeToParcel
|
||||
// CURIOUS_ABOUT: writeToParcel
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlinx.parcelize.*
|
||||
import android.os.Parcelable
|
||||
|
||||
@Parcelize
|
||||
class Test(val names: List<List<ArrayList<String>>>): Parcelable
|
||||
class Test(val names: List<List<ArrayList<String>>>): Parcelable
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT writeToParcel
|
||||
// CURIOUS_ABOUT: writeToParcel
|
||||
// WITH_RUNTIME
|
||||
|
||||
import android.util.Size
|
||||
@@ -9,4 +9,4 @@ import android.os.Parcelable
|
||||
class TestNullable(val a: Size?): Parcelable
|
||||
|
||||
@Parcelize
|
||||
class TestNotNull(val a: Size): Parcelable
|
||||
class TestNotNull(val a: Size): Parcelable
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ public final class test/Foo$Creator : java/lang/Object, android/os/Parcelable$Cr
|
||||
|
||||
public java.lang.Object createFromParcel(android.os.Parcel p0) {
|
||||
LABEL (L0)
|
||||
LINENUMBER (8)
|
||||
LINENUMBER (37)
|
||||
ALOAD (0)
|
||||
ALOAD (1)
|
||||
INVOKEVIRTUAL (test/Foo$Creator, createFromParcel, (Landroid/os/Parcel;)Ltest/Foo;)
|
||||
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT writeToParcel, createFromParcel, <clinit>
|
||||
// CURIOUS_ABOUT: writeToParcel, createFromParcel, <clinit>
|
||||
// WITH_RUNTIME
|
||||
|
||||
//FILE: test/JavaClass.java
|
||||
@@ -34,4 +34,4 @@ import kotlinx.parcelize.*
|
||||
import android.os.Parcelable
|
||||
|
||||
@Parcelize
|
||||
class Foo(val parcelable: Parcelable): Parcelable
|
||||
class Foo(val parcelable: Parcelable): Parcelable
|
||||
|
||||
+1
-1
@@ -324,4 +324,4 @@ public final class ParcelableCreatorKt : java/lang/Object {
|
||||
LINENUMBER (28)
|
||||
RETURN
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT test1, test2, test3
|
||||
// CURIOUS_ABOUT: test1, test2, test3
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlinx.parcelize.*
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
// CURIOUS_ABOUT writeToParcel, createFromParcel
|
||||
// CURIOUS_ABOUT: writeToParcel, createFromParcel
|
||||
// WITH_RUNTIME
|
||||
|
||||
// The JVM backend doesn't support ShortArray
|
||||
// IGNORE_BACKEND: JVM
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
/*
|
||||
* Serializing of short arrays is not properly supported in old frontend, so this
|
||||
* test is on only for JVM IR backend
|
||||
*/
|
||||
|
||||
import kotlinx.parcelize.*
|
||||
import android.os.Parcelable
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT writeToParcel, createFromParcel, <clinit>
|
||||
// CURIOUS_ABOUT: writeToParcel, createFromParcel, <clinit>
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlinx.parcelize.*
|
||||
@@ -8,4 +8,4 @@ import java.io.Serializable
|
||||
class SerializableSimple(val a: String, val b: String) : Serializable
|
||||
|
||||
@Parcelize
|
||||
class User(val notNull: SerializableSimple, val nullable: SerializableSimple) : Parcelable
|
||||
class User(val notNull: SerializableSimple, val nullable: SerializableSimple) : Parcelable
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT writeToParcel, createFromParcel, <clinit>, describeContents
|
||||
// CURIOUS_ABOUT: writeToParcel, createFromParcel, <clinit>, describeContents
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlinx.parcelize.*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT writeToParcel, createFromParcel, <clinit>, describeContents
|
||||
// CURIOUS_ABOUT: writeToParcel, createFromParcel, <clinit>, describeContents
|
||||
// WITH_RUNTIME
|
||||
// LOCAL_VARIABLE_TABLE
|
||||
|
||||
@@ -6,4 +6,4 @@ import kotlinx.parcelize.*
|
||||
import android.os.Parcelable
|
||||
|
||||
@Parcelize
|
||||
class User(val firstName: String, val lastName: String, val age: Int, val isProUser: Boolean) : Parcelable
|
||||
class User(val firstName: String, val lastName: String, val age: Int, val isProUser: Boolean) : Parcelable
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// CURIOUS_ABOUT writeToParcel
|
||||
// CURIOUS_ABOUT: writeToParcel
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlinx.parcelize.*
|
||||
import android.os.Parcelable
|
||||
|
||||
@Parcelize
|
||||
class Test(val names: List<String>): Parcelable
|
||||
class Test(val names: List<String>): Parcelable
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT writeToParcel, createFromParcel
|
||||
// CURIOUS_ABOUT: writeToParcel, createFromParcel
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlinx.parcelize.*
|
||||
@@ -10,4 +10,4 @@ import android.util.SizeF
|
||||
data class Test(val size: Size, val nullable: Size?) : Parcelable
|
||||
|
||||
@Parcelize
|
||||
data class TestF(val size: SizeF, val nullable: SizeF?) : Parcelable
|
||||
data class TestF(val size: SizeF, val nullable: SizeF?) : Parcelable
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// CURIOUS_ABOUT writeToParcel, createFromParcel
|
||||
// CURIOUS_ABOUT: writeToParcel, createFromParcel
|
||||
// WITH_RUNTIME
|
||||
// IGNORE_BACKEND: JVM
|
||||
|
||||
|
||||
+80
-10
@@ -3,403 +3,473 @@
|
||||
* 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.parcelize.test;
|
||||
package org.jetbrains.kotlin.parcelize.test.runners;
|
||||
|
||||
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 org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
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 */
|
||||
/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("plugins/parcelize/parcelize-compiler/testData/box")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class ParcelizeBoxTestGenerated extends AbstractParcelizeBoxTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllFilesPresentInBox() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/parcelize/parcelize-compiler/testData/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("allPrimitiveTypes.kt")
|
||||
public void testAllPrimitiveTypes() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/allPrimitiveTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("allUnsignedTypes.kt")
|
||||
public void testAllUnsignedTypes() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/allUnsignedTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("arraySimple.kt")
|
||||
public void testArraySimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/arraySimple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("arrays.kt")
|
||||
public void testArrays() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/arrays.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("binder.kt")
|
||||
public void testBinder() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/binder.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("boxedTypes.kt")
|
||||
public void testBoxedTypes() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/boxedTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("bundle.kt")
|
||||
public void testBundle() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/bundle.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("charSequence.kt")
|
||||
public void testCharSequence() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/charSequence.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customNewArray.kt")
|
||||
public void testCustomNewArray() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/customNewArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customParcelable.kt")
|
||||
public void testCustomParcelable() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/customParcelable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customParcelerScoping.kt")
|
||||
public void testCustomParcelerScoping() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/customParcelerScoping.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customSerializerBoxing.kt")
|
||||
public void testCustomSerializerBoxing() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/customSerializerBoxing.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customSerializerSimple.kt")
|
||||
public void testCustomSerializerSimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/customSerializerSimple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customSerializerWriteWith.kt")
|
||||
public void testCustomSerializerWriteWith() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/customSerializerWriteWith.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customSimple.kt")
|
||||
public void testCustomSimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/customSimple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumObject.kt")
|
||||
public void testEnumObject() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/enumObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enums.kt")
|
||||
public void testEnums() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/enums.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exceptions.kt")
|
||||
public void testExceptions() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/exceptions.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functions.kt")
|
||||
public void testFunctions() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/functions.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericParcelable.kt")
|
||||
public void testGenericParcelable() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/genericParcelable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("generics.kt")
|
||||
public void testGenerics() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/generics.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intArray.kt")
|
||||
public void testIntArray() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/intArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaInterop.kt")
|
||||
public void testJavaInterop() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/javaInterop.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt19747.kt")
|
||||
public void testKt19747() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt19747.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt19747Deprecated.kt")
|
||||
public void testKt19747Deprecated() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt19747Deprecated.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt19747_2.kt")
|
||||
public void testKt19747_2() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt19747_2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt19749.kt")
|
||||
public void testKt19749() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt19749.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt19853.kt")
|
||||
public void testKt19853() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt19853.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt20002.kt")
|
||||
public void testKt20002() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt20002.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt20021.kt")
|
||||
public void testKt20021() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt20021.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt20717.kt")
|
||||
public void testKt20717() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt20717.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt25839.kt")
|
||||
public void testKt25839() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt25839.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt26221.kt")
|
||||
public void testKt26221() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt26221.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt36658.kt")
|
||||
public void testKt36658() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt36658.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt39981.kt")
|
||||
public void testKt39981() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt39981.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt41553.kt")
|
||||
public void testKt41553() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt41553.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt41553_2.kt")
|
||||
public void testKt41553_2() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt41553_2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt46567.kt")
|
||||
public void testKt46567() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt46567.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("listKinds.kt")
|
||||
public void testListKinds() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/listKinds.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("listSimple.kt")
|
||||
public void testListSimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/listSimple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lists.kt")
|
||||
public void testLists() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/lists.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mapKinds.kt")
|
||||
public void testMapKinds() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/mapKinds.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mapSimple.kt")
|
||||
public void testMapSimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/mapSimple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("maps.kt")
|
||||
public void testMaps() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/maps.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedArrays.kt")
|
||||
public void testNestedArrays() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/nestedArrays.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedLists.kt")
|
||||
public void testNestedLists() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/nestedLists.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedMaps.kt")
|
||||
public void testNestedMaps() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/nestedMaps.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedParcelable.kt")
|
||||
public void testNestedParcelable() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/nestedParcelable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedSparseArrays.kt")
|
||||
public void testNestedSparseArrays() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/nestedSparseArrays.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedSparseArrays2.kt")
|
||||
public void testNestedSparseArrays2() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/nestedSparseArrays2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("newArray.kt")
|
||||
public void testNewArray() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/newArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("newArrayParceler.kt")
|
||||
public void testNewArrayParceler() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/newArrayParceler.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableTypes.kt")
|
||||
public void testNullableTypes() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/nullableTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableTypesSimple.kt")
|
||||
public void testNullableTypesSimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/nullableTypesSimple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("objectWriteParcelable.kt")
|
||||
public void testObjectWriteParcelable() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/objectWriteParcelable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("objects.kt")
|
||||
public void testObjects() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/objects.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("openParcelize.kt")
|
||||
public void testOpenParcelize() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/openParcelize.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("parcelableValueClass.kt")
|
||||
public void testParcelableValueClass() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/parcelableValueClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("parcelizeCustomValueClass.kt")
|
||||
public void testParcelizeCustomValueClass() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/parcelizeCustomValueClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("persistableBundle.kt")
|
||||
public void testPersistableBundle() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/persistableBundle.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitiveTypes.kt")
|
||||
public void testPrimitiveTypes() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/primitiveTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("privateConstructor.kt")
|
||||
public void testPrivateConstructor() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/privateConstructor.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("recursiveGenerics.kt")
|
||||
public void testRecursiveGenerics() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/recursiveGenerics.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("sealedClass.kt")
|
||||
public void testSealedClass() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/sealedClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("sealedClass2.kt")
|
||||
public void testSealedClass2() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/sealedClass2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("sealedInterface.kt")
|
||||
public void testSealedInterface() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/sealedInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("shortArray.kt")
|
||||
public void testShortArray() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/shortArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/simple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simpleDeprecated.kt")
|
||||
public void testSimpleDeprecated() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/simpleDeprecated.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("sparseArrays.kt")
|
||||
public void testSparseArrays() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/sparseArrays.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("sparseBooleanArray.kt")
|
||||
public void testSparseBooleanArray() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/sparseBooleanArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeParameters.kt")
|
||||
public void testTypeParameters() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/typeParameters.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unsignedArrays.kt")
|
||||
public void testUnsignedArrays() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/unsignedArrays.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("valueClassWrapper.kt")
|
||||
public void testValueClassWrapper() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/valueClassWrapper.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("valueClasses.kt")
|
||||
public void testValueClasses() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/valueClasses.kt");
|
||||
+27
-15
@@ -3,143 +3,155 @@
|
||||
* 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.parcelize.test;
|
||||
package org.jetbrains.kotlin.parcelize.test.runners;
|
||||
|
||||
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 org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
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 */
|
||||
/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("plugins/parcelize/parcelize-compiler/testData/codegen")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class ParcelizeBytecodeListingTestGenerated extends AbstractParcelizeBytecodeListingTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllFilesPresentInCodegen() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/parcelize/parcelize-compiler/testData/codegen"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("classLoaderValues.kt")
|
||||
public void testClassLoaderValues() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/classLoaderValues.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customDescribeContents.kt")
|
||||
public void testCustomDescribeContents() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/customDescribeContents.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customParcelablesDifferentModule.kt")
|
||||
public void testCustomParcelablesDifferentModule() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/customParcelablesDifferentModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customParcelablesSameModule.kt")
|
||||
public void testCustomParcelablesSameModule() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/customParcelablesSameModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customSimple.kt")
|
||||
public void testCustomSimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/customSimple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customSimpleWithNewArray.kt")
|
||||
public void testCustomSimpleWithNewArray() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/customSimpleWithNewArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("describeContentsFromSuperType.kt")
|
||||
public void testDescribeContentsFromSuperType() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/describeContentsFromSuperType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("duplicatingClinit.kt")
|
||||
public void testDuplicatingClinit() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/duplicatingClinit.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("efficientParcelable.kt")
|
||||
public void testEfficientParcelable() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/efficientParcelable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("generics.kt")
|
||||
public void testGenerics() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/generics.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("IBinderIInterface.kt")
|
||||
public void testIBinderIInterface() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/IBinderIInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt25839.kt")
|
||||
public void testKt25839() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/kt25839.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("listInsideList.kt")
|
||||
public void testListInsideList() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/listInsideList.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableNotNullSize.kt")
|
||||
public void testNullableNotNullSize() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/nullableNotNullSize.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("parcelable.kt")
|
||||
public void testParcelable() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/parcelable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("parcelableCreator.kt")
|
||||
public void testParcelableCreator() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/parcelableCreator.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primitiveArrays.kt")
|
||||
public void testPrimitiveArrays() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/primitiveArrays.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("serializable.kt")
|
||||
public void testSerializable() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/serializable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("serializeValue.kt")
|
||||
public void testSerializeValue() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/serializeValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/simple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simpleList.kt")
|
||||
public void testSimpleList() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/simpleList.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("size.kt")
|
||||
public void testSize() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/size.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unsignedPrimitiveArrays.kt")
|
||||
public void testUnsignedPrimitiveArrays() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/unsignedPrimitiveArrays.kt");
|
||||
+80
-10
@@ -3,403 +3,473 @@
|
||||
* 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.parcelize.test;
|
||||
package org.jetbrains.kotlin.parcelize.test.runners;
|
||||
|
||||
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 org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
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 */
|
||||
/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("plugins/parcelize/parcelize-compiler/testData/box")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class ParcelizeIrBoxTestGenerated extends AbstractParcelizeIrBoxTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllFilesPresentInBox() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/parcelize/parcelize-compiler/testData/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("allPrimitiveTypes.kt")
|
||||
public void testAllPrimitiveTypes() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/allPrimitiveTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("allUnsignedTypes.kt")
|
||||
public void testAllUnsignedTypes() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/allUnsignedTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("arraySimple.kt")
|
||||
public void testArraySimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/arraySimple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("arrays.kt")
|
||||
public void testArrays() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/arrays.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("binder.kt")
|
||||
public void testBinder() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/binder.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("boxedTypes.kt")
|
||||
public void testBoxedTypes() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/boxedTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("bundle.kt")
|
||||
public void testBundle() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/bundle.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("charSequence.kt")
|
||||
public void testCharSequence() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/charSequence.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customNewArray.kt")
|
||||
public void testCustomNewArray() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/customNewArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customParcelable.kt")
|
||||
public void testCustomParcelable() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/customParcelable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customParcelerScoping.kt")
|
||||
public void testCustomParcelerScoping() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/customParcelerScoping.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customSerializerBoxing.kt")
|
||||
public void testCustomSerializerBoxing() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/customSerializerBoxing.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customSerializerSimple.kt")
|
||||
public void testCustomSerializerSimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/customSerializerSimple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customSerializerWriteWith.kt")
|
||||
public void testCustomSerializerWriteWith() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/customSerializerWriteWith.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customSimple.kt")
|
||||
public void testCustomSimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/customSimple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enumObject.kt")
|
||||
public void testEnumObject() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/enumObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("enums.kt")
|
||||
public void testEnums() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/enums.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("exceptions.kt")
|
||||
public void testExceptions() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/exceptions.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functions.kt")
|
||||
public void testFunctions() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/functions.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("genericParcelable.kt")
|
||||
public void testGenericParcelable() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/genericParcelable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("generics.kt")
|
||||
public void testGenerics() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/generics.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("intArray.kt")
|
||||
public void testIntArray() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/intArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaInterop.kt")
|
||||
public void testJavaInterop() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/javaInterop.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt19747.kt")
|
||||
public void testKt19747() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt19747.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt19747Deprecated.kt")
|
||||
public void testKt19747Deprecated() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt19747Deprecated.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt19747_2.kt")
|
||||
public void testKt19747_2() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt19747_2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt19749.kt")
|
||||
public void testKt19749() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt19749.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt19853.kt")
|
||||
public void testKt19853() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt19853.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt20002.kt")
|
||||
public void testKt20002() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt20002.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt20021.kt")
|
||||
public void testKt20021() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt20021.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt20717.kt")
|
||||
public void testKt20717() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt20717.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt25839.kt")
|
||||
public void testKt25839() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt25839.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt26221.kt")
|
||||
public void testKt26221() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt26221.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt36658.kt")
|
||||
public void testKt36658() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt36658.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt39981.kt")
|
||||
public void testKt39981() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt39981.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt41553.kt")
|
||||
public void testKt41553() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt41553.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt41553_2.kt")
|
||||
public void testKt41553_2() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt41553_2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt46567.kt")
|
||||
public void testKt46567() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/kt46567.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("listKinds.kt")
|
||||
public void testListKinds() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/listKinds.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("listSimple.kt")
|
||||
public void testListSimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/listSimple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lists.kt")
|
||||
public void testLists() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/lists.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mapKinds.kt")
|
||||
public void testMapKinds() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/mapKinds.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mapSimple.kt")
|
||||
public void testMapSimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/mapSimple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("maps.kt")
|
||||
public void testMaps() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/maps.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedArrays.kt")
|
||||
public void testNestedArrays() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/nestedArrays.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedLists.kt")
|
||||
public void testNestedLists() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/nestedLists.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedMaps.kt")
|
||||
public void testNestedMaps() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/nestedMaps.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedParcelable.kt")
|
||||
public void testNestedParcelable() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/nestedParcelable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedSparseArrays.kt")
|
||||
public void testNestedSparseArrays() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/nestedSparseArrays.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nestedSparseArrays2.kt")
|
||||
public void testNestedSparseArrays2() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/nestedSparseArrays2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("newArray.kt")
|
||||
public void testNewArray() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/newArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("newArrayParceler.kt")
|
||||
public void testNewArrayParceler() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/newArrayParceler.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableTypes.kt")
|
||||
public void testNullableTypes() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/nullableTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableTypesSimple.kt")
|
||||
public void testNullableTypesSimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/nullableTypesSimple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("objectWriteParcelable.kt")
|
||||
public void testObjectWriteParcelable() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/objectWriteParcelable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("objects.kt")
|
||||
public void testObjects() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/objects.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("openParcelize.kt")
|
||||
public void testOpenParcelize() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/openParcelize.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("parcelableValueClass.kt")
|
||||
public void testParcelableValueClass() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/parcelableValueClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("parcelizeCustomValueClass.kt")
|
||||
public void testParcelizeCustomValueClass() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/parcelizeCustomValueClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("persistableBundle.kt")
|
||||
public void testPersistableBundle() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/persistableBundle.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitiveTypes.kt")
|
||||
public void testPrimitiveTypes() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/primitiveTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("privateConstructor.kt")
|
||||
public void testPrivateConstructor() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/privateConstructor.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("recursiveGenerics.kt")
|
||||
public void testRecursiveGenerics() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/recursiveGenerics.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("sealedClass.kt")
|
||||
public void testSealedClass() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/sealedClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("sealedClass2.kt")
|
||||
public void testSealedClass2() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/sealedClass2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("sealedInterface.kt")
|
||||
public void testSealedInterface() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/sealedInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("shortArray.kt")
|
||||
public void testShortArray() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/shortArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/simple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simpleDeprecated.kt")
|
||||
public void testSimpleDeprecated() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/simpleDeprecated.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("sparseArrays.kt")
|
||||
public void testSparseArrays() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/sparseArrays.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("sparseBooleanArray.kt")
|
||||
public void testSparseBooleanArray() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/sparseBooleanArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeParameters.kt")
|
||||
public void testTypeParameters() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/typeParameters.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unsignedArrays.kt")
|
||||
public void testUnsignedArrays() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/unsignedArrays.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("valueClassWrapper.kt")
|
||||
public void testValueClassWrapper() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/valueClassWrapper.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("valueClasses.kt")
|
||||
public void testValueClasses() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/valueClasses.kt");
|
||||
+28
-10
@@ -3,143 +3,161 @@
|
||||
* 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.parcelize.test;
|
||||
package org.jetbrains.kotlin.parcelize.test.runners;
|
||||
|
||||
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 org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
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 */
|
||||
/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("plugins/parcelize/parcelize-compiler/testData/codegen")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class ParcelizeIrBytecodeListingTestGenerated extends AbstractParcelizeIrBytecodeListingTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllFilesPresentInCodegen() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/parcelize/parcelize-compiler/testData/codegen"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("classLoaderValues.kt")
|
||||
public void testClassLoaderValues() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/classLoaderValues.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customDescribeContents.kt")
|
||||
public void testCustomDescribeContents() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/customDescribeContents.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customParcelablesDifferentModule.kt")
|
||||
public void testCustomParcelablesDifferentModule() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/customParcelablesDifferentModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customParcelablesSameModule.kt")
|
||||
public void testCustomParcelablesSameModule() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/customParcelablesSameModule.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customSimple.kt")
|
||||
public void testCustomSimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/customSimple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("customSimpleWithNewArray.kt")
|
||||
public void testCustomSimpleWithNewArray() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/customSimpleWithNewArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("describeContentsFromSuperType.kt")
|
||||
public void testDescribeContentsFromSuperType() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/describeContentsFromSuperType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("duplicatingClinit.kt")
|
||||
public void testDuplicatingClinit() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/duplicatingClinit.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("efficientParcelable.kt")
|
||||
public void testEfficientParcelable() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/efficientParcelable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("generics.kt")
|
||||
public void testGenerics() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/generics.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("IBinderIInterface.kt")
|
||||
public void testIBinderIInterface() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/IBinderIInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt25839.kt")
|
||||
public void testKt25839() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/kt25839.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("listInsideList.kt")
|
||||
public void testListInsideList() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/listInsideList.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableNotNullSize.kt")
|
||||
public void testNullableNotNullSize() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/nullableNotNullSize.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("parcelable.kt")
|
||||
public void testParcelable() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/parcelable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("parcelableCreator.kt")
|
||||
public void testParcelableCreator() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/parcelableCreator.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitiveArrays.kt")
|
||||
public void testPrimitiveArrays() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/primitiveArrays.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("serializable.kt")
|
||||
public void testSerializable() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/serializable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("serializeValue.kt")
|
||||
public void testSerializeValue() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/serializeValue.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/simple.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simpleList.kt")
|
||||
public void testSimpleList() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/simpleList.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("size.kt")
|
||||
public void testSize() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/size.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unsignedPrimitiveArrays.kt")
|
||||
public void testUnsignedPrimitiveArrays() throws Exception {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/codegen/unsignedPrimitiveArrays.kt");
|
||||
-192
@@ -1,192 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. 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.parcelize.test
|
||||
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
|
||||
import org.jetbrains.kotlin.cli.jvm.config.JvmClasspathRoot
|
||||
import org.jetbrains.kotlin.codegen.CodegenTestCase
|
||||
import org.jetbrains.kotlin.codegen.getClassFiles
|
||||
import org.jetbrains.kotlin.parcelize.ParcelizeComponentRegistrar
|
||||
import org.jetbrains.kotlin.test.TargetBackend
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil
|
||||
import org.jetbrains.kotlin.utils.PathUtil
|
||||
import org.jetbrains.org.objectweb.asm.ClassWriter
|
||||
import org.jetbrains.org.objectweb.asm.ClassWriter.COMPUTE_FRAMES
|
||||
import org.jetbrains.org.objectweb.asm.ClassWriter.COMPUTE_MAXS
|
||||
import org.jetbrains.org.objectweb.asm.Label
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes.*
|
||||
import org.jetbrains.org.objectweb.asm.Type
|
||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
|
||||
import org.junit.runner.JUnitCore
|
||||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
abstract class AbstractParcelizeIrBoxTest : AbstractParcelizeBoxTest() {
|
||||
override val backend = TargetBackend.JVM_IR
|
||||
}
|
||||
|
||||
abstract class AbstractParcelizeBoxTest : CodegenTestCase() {
|
||||
companion object {
|
||||
val LIBRARY_KT = File("plugins/parcelize/parcelize-compiler/testData/boxLib.kt")
|
||||
private const val ANDROID_TOOLS_PREFIX = "studio.android.sdktools."
|
||||
|
||||
private val androidPluginPath: String by lazy {
|
||||
System.getProperty("ideaSdk.androidPlugin.path")?.takeIf { File(it).isDirectory }
|
||||
?: throw RuntimeException("Unable to get a valid path from 'ideaSdk.androidPlugin.path' property, please point it to the Idea android plugin location")
|
||||
}
|
||||
|
||||
private fun getLayoutLibFile(pattern: String): File {
|
||||
val nameRegex = "^($ANDROID_TOOLS_PREFIX)?$pattern-[0-9\\.]+\\.jar$".toRegex()
|
||||
return File(androidPluginPath).listFiles().orEmpty().singleOrNull { it.name.matches(nameRegex) }
|
||||
?: error("Can't find file for pattern $nameRegex in $androidPluginPath. " +
|
||||
"Available files: \n${File(androidPluginPath).list().orEmpty().asList()}")
|
||||
}
|
||||
|
||||
val layoutlibJar: File by lazy { getLayoutLibFile("layoutlib(-jre[0-9]+)?") }
|
||||
val layoutlibApiJar: File by lazy { getLayoutLibFile("layoutlib-api") }
|
||||
|
||||
private val JUNIT_GENERATED_TEST_CLASS_BYTES by lazy { constructSyntheticTestClass() }
|
||||
private const val JUNIT_GENERATED_TEST_CLASS_FQNAME = "test.JunitTest"
|
||||
|
||||
private fun constructSyntheticTestClass(): ByteArray {
|
||||
return with(ClassWriter(COMPUTE_MAXS or COMPUTE_FRAMES)) {
|
||||
visit(49, ACC_PUBLIC, JUNIT_GENERATED_TEST_CLASS_FQNAME.replace('.', '/'), null, "java/lang/Object", emptyArray())
|
||||
visitSource(null, null)
|
||||
|
||||
with(visitAnnotation("Lorg/junit/runner/RunWith;", true)) {
|
||||
visit("value", Type.getType("Lorg/robolectric/RobolectricTestRunner;"))
|
||||
visitEnd()
|
||||
}
|
||||
|
||||
with(visitAnnotation("Lorg/robolectric/annotation/Config;", true)) {
|
||||
visit("sdk", intArrayOf(21))
|
||||
visit("manifest", "--none")
|
||||
visitEnd()
|
||||
}
|
||||
|
||||
with(visitMethod(ACC_PUBLIC, "<init>", "()V", null, null)) {
|
||||
visitVarInsn(ALOAD, 0)
|
||||
visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false)
|
||||
|
||||
visitInsn(RETURN)
|
||||
visitMaxs(-1, -1)
|
||||
visitEnd()
|
||||
}
|
||||
|
||||
with(visitMethod(ACC_PUBLIC, "test", "()V", null, null)) {
|
||||
visitAnnotation("Lorg/junit/Test;", true).visitEnd()
|
||||
|
||||
val v = InstructionAdapter(this)
|
||||
|
||||
val assertionOk = Label()
|
||||
|
||||
v.invokestatic("test/TestKt", "box", "()Ljava/lang/String;", false) // -> ret
|
||||
v.dup() // -> ret, ret
|
||||
v.aconst("OK") // -> ret, ret, ok
|
||||
v.invokevirtual("java/lang/String", "equals", "(Ljava/lang/Object;)Z", false) // -> ret, eq
|
||||
v.ifne(assertionOk) // -> ret
|
||||
|
||||
val assertionErrorType = Type.getObjectType("java/lang/AssertionError")
|
||||
|
||||
v.anew(assertionErrorType) // -> ret, ae
|
||||
v.dupX1() // -> ae, ret, ae
|
||||
v.swap() // -> ae, ae, ret
|
||||
v.invokespecial(assertionErrorType.internalName, "<init>", "(Ljava/lang/Object;)V", false) // -> ae
|
||||
v.athrow()
|
||||
|
||||
v.visitLabel(assertionOk)
|
||||
v.pop() // -> [empty]
|
||||
v.areturn(Type.VOID_TYPE)
|
||||
|
||||
visitMaxs(-1, -1)
|
||||
visitEnd()
|
||||
}
|
||||
|
||||
visitEnd()
|
||||
toByteArray()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getClasspathForTest(): List<File> {
|
||||
val kotlinRuntimeJar = PathUtil.kotlinPathsForIdeaPlugin.stdlibPath
|
||||
|
||||
val robolectricClasspath = System.getProperty("robolectric.classpath")
|
||||
?: throw RuntimeException("Unable to get a valid classpath from 'robolectric.classpath' property, please set it accordingly")
|
||||
val robolectricJars = robolectricClasspath.split(File.pathSeparator)
|
||||
.map { File(it) }
|
||||
.sortedBy { it.nameWithoutExtension }
|
||||
|
||||
val junitCoreResourceName = JUnitCore::class.java.name.replace('.', '/') + ".class"
|
||||
val junitJar = File(
|
||||
JUnitCore::class.java.classLoader.getResource(junitCoreResourceName)!!.file
|
||||
.substringAfter("file:")
|
||||
.substringBeforeLast('!')
|
||||
)
|
||||
|
||||
val parcelizeRuntimeJars = System.getProperty("parcelizeRuntime.classpath")?.split(File.pathSeparator)?.map(::File)
|
||||
?: error("Unable to get a valid classpath from 'parcelizeRuntime.classpath' property")
|
||||
|
||||
return listOf(kotlinRuntimeJar, layoutlibJar, layoutlibApiJar) + robolectricJars + junitJar + parcelizeRuntimeJars
|
||||
}
|
||||
|
||||
override fun doMultiFileTest(wholeFile: File, files: List<TestFile>) {
|
||||
compile(files + TestFile(LIBRARY_KT.name, LIBRARY_KT.readText()))
|
||||
|
||||
val javaBin = File(System.getProperty("java.home").takeIf { it.isNotEmpty() } ?: error("JAVA_HOME is not set"), "bin")
|
||||
val javaExe = File(javaBin, "java.exe").takeIf { it.exists() } ?: File(javaBin, "java")
|
||||
assert(javaExe.exists()) { "Can't find 'java' executable in $javaBin" }
|
||||
|
||||
val libraryClasspath = getClasspathForTest()
|
||||
val dirForTestClasses = Files.createTempDirectory("parcel").toFile()
|
||||
|
||||
fun writeClass(fqNameOrPath: String, bytes: ByteArray) {
|
||||
val path = if (fqNameOrPath.endsWith(".class")) fqNameOrPath else (fqNameOrPath.replace('.', '/') + ".class")
|
||||
File(dirForTestClasses, path).also { it.parentFile.mkdirs() }.writeBytes(bytes)
|
||||
}
|
||||
|
||||
try {
|
||||
writeClass(JUNIT_GENERATED_TEST_CLASS_FQNAME, JUNIT_GENERATED_TEST_CLASS_BYTES)
|
||||
classFileFactory.getClassFiles().forEach { writeClass(it.relativePath, it.asByteArray()) }
|
||||
javaClassesOutputDirectory?.listFiles()?.forEach { writeClass(it.name, it.readBytes()) }
|
||||
|
||||
val process = ProcessBuilder(
|
||||
javaExe.absolutePath,
|
||||
"-ea",
|
||||
"-classpath",
|
||||
(libraryClasspath + dirForTestClasses).joinToString(File.pathSeparator) { it.absolutePath },
|
||||
JUnitCore::class.java.name,
|
||||
JUNIT_GENERATED_TEST_CLASS_FQNAME
|
||||
).start()
|
||||
|
||||
val out = process.inputStream.bufferedReader().lineSequence().joinToString("\n")
|
||||
val err = process.errorStream.bufferedReader().lineSequence().joinToString("\n")
|
||||
|
||||
process.waitFor(3, TimeUnit.MINUTES)
|
||||
if (process.exitValue() != 0) {
|
||||
println(out)
|
||||
println(err)
|
||||
|
||||
throw AssertionError("Process exited with exit code ${process.exitValue()} \n" + classFileFactory.createText())
|
||||
}
|
||||
} finally {
|
||||
if (!dirForTestClasses.deleteRecursively()) {
|
||||
throw AssertionError("Unable to delete $dirForTestClasses")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun setupEnvironment(environment: KotlinCoreEnvironment) {
|
||||
ParcelizeComponentRegistrar.registerParcelizeComponents(environment.project)
|
||||
addParcelizeRuntimeLibrary(environment)
|
||||
environment.updateClasspath(listOf(JvmClasspathRoot(KtTestUtil.findAndroidApiJar())))
|
||||
}
|
||||
|
||||
override fun updateJavaClasspath(javaClasspath: MutableList<String>) {
|
||||
javaClasspath += KtTestUtil.findAndroidApiJar().absolutePath
|
||||
}
|
||||
}
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. 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.parcelize.test
|
||||
|
||||
import org.jetbrains.kotlin.ObsoleteTestInfrastructure
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
|
||||
import org.jetbrains.kotlin.codegen.AbstractAsmLikeInstructionListingTest
|
||||
import org.jetbrains.kotlin.parcelize.ParcelizeComponentRegistrar
|
||||
import org.jetbrains.kotlin.test.TargetBackend
|
||||
import java.io.File
|
||||
|
||||
@OptIn(ObsoleteTestInfrastructure::class)
|
||||
abstract class AbstractParcelizeBytecodeListingTest : AbstractAsmLikeInstructionListingTest() {
|
||||
override fun setupEnvironment(environment: KotlinCoreEnvironment) {
|
||||
ParcelizeComponentRegistrar.registerParcelizeComponents(environment.project)
|
||||
addParcelizeRuntimeLibrary(environment)
|
||||
addAndroidJarLibrary(environment)
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AbstractParcelizeIrBytecodeListingTest : AbstractParcelizeBytecodeListingTest() {
|
||||
override val backend = TargetBackend.JVM_IR
|
||||
|
||||
override fun getExpectedTextFileName(wholeFile: File): String {
|
||||
return wholeFile.nameWithoutExtension + ".ir.txt"
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.parcelize.test
|
||||
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.extensions.SyntheticResolveExtension
|
||||
|
||||
class ParcelizeBoxTestWithSerializableLikeExtension : AbstractParcelizeBoxTest() {
|
||||
fun testSimple() = doTest("plugins/parcelize/parcelize-compiler/testData/box/simple.kt")
|
||||
|
||||
override fun setupEnvironment(environment: KotlinCoreEnvironment) {
|
||||
super.setupEnvironment(environment)
|
||||
SyntheticResolveExtension.registerExtension(environment.project, SerializableLike())
|
||||
}
|
||||
|
||||
private class SerializableLike : SyntheticResolveExtension {
|
||||
override fun getSyntheticCompanionObjectNameIfNeeded(thisDescriptor: ClassDescriptor): Name? {
|
||||
fun ClassDescriptor.isSerializableLike() = annotations.hasAnnotation(FqName("test.SerializableLike"))
|
||||
|
||||
return when {
|
||||
thisDescriptor.kind == ClassKind.CLASS && thisDescriptor.isSerializableLike() -> Name.identifier("Companion")
|
||||
else -> return null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* 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.parcelize.test.runners
|
||||
|
||||
import org.jetbrains.kotlin.parcelize.test.services.ParcelizeEnvironmentConfigurator
|
||||
import org.jetbrains.kotlin.parcelize.test.services.ParcelizeMainClassProvider
|
||||
import org.jetbrains.kotlin.parcelize.test.services.ParcelizeRuntimeClasspathProvider
|
||||
import org.jetbrains.kotlin.parcelize.test.services.ParcelizeUtilSourcesProvider
|
||||
import org.jetbrains.kotlin.test.Constructor
|
||||
import org.jetbrains.kotlin.test.TargetBackend
|
||||
import org.jetbrains.kotlin.test.backend.BlackBoxCodegenSuppressor
|
||||
import org.jetbrains.kotlin.test.backend.classic.ClassicBackendInput
|
||||
import org.jetbrains.kotlin.test.backend.classic.ClassicJvmBackendFacade
|
||||
import org.jetbrains.kotlin.test.backend.ir.IrBackendInput
|
||||
import org.jetbrains.kotlin.test.backend.ir.JvmIrBackendFacade
|
||||
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
|
||||
import org.jetbrains.kotlin.test.builders.configureClassicFrontendHandlersStep
|
||||
import org.jetbrains.kotlin.test.builders.configureFirHandlersStep
|
||||
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives
|
||||
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.REQUIRES_SEPARATE_PROCESS
|
||||
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.frontend.classic.ClassicFrontend2ClassicBackendConverter
|
||||
import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontend2IrConverter
|
||||
import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendFacade
|
||||
import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendOutputArtifact
|
||||
import org.jetbrains.kotlin.test.frontend.classic.handlers.ClassicDiagnosticsHandler
|
||||
import org.jetbrains.kotlin.test.frontend.fir.handlers.FirDiagnosticsHandler
|
||||
import org.jetbrains.kotlin.test.model.*
|
||||
import org.jetbrains.kotlin.test.runners.AbstractKotlinCompilerWithTargetBackendTest
|
||||
import org.jetbrains.kotlin.test.runners.codegen.commonConfigurationForCodegenTest
|
||||
import org.jetbrains.kotlin.test.runners.codegen.configureCommonHandlersForBoxTest
|
||||
import org.jetbrains.kotlin.test.services.jvm.JvmBoxMainClassProvider
|
||||
import org.jetbrains.kotlin.test.services.service
|
||||
|
||||
abstract class AbstractParcelizeBoxTestBase<R : ResultingArtifact.FrontendOutput<R>, I : ResultingArtifact.BackendInput<I>>(
|
||||
val targetFrontend: FrontendKind<R>,
|
||||
targetBackend: TargetBackend
|
||||
) : AbstractKotlinCompilerWithTargetBackendTest(targetBackend) {
|
||||
abstract val frontendFacade: Constructor<FrontendFacade<R>>
|
||||
abstract val frontendToBackendConverter: Constructor<Frontend2BackendConverter<R, I>>
|
||||
abstract val backendFacade: Constructor<BackendFacade<I, BinaryArtifacts.Jvm>>
|
||||
|
||||
override fun TestConfigurationBuilder.configuration() {
|
||||
defaultDirectives {
|
||||
DIAGNOSTICS with "-warnings"
|
||||
+REQUIRES_SEPARATE_PROCESS
|
||||
+REPORT_ONLY_EXPLICITLY_DEFINED_DEBUG_INFO
|
||||
}
|
||||
|
||||
commonConfigurationForCodegenTest(targetFrontend, frontendFacade, frontendToBackendConverter, backendFacade)
|
||||
|
||||
configureClassicFrontendHandlersStep {
|
||||
useHandlers(
|
||||
::ClassicDiagnosticsHandler
|
||||
)
|
||||
}
|
||||
|
||||
configureFirHandlersStep {
|
||||
useHandlers(
|
||||
::FirDiagnosticsHandler
|
||||
)
|
||||
}
|
||||
|
||||
configureCommonHandlersForBoxTest()
|
||||
|
||||
useCustomRuntimeClasspathProviders(::ParcelizeRuntimeClasspathProvider)
|
||||
useConfigurators(::ParcelizeEnvironmentConfigurator)
|
||||
useAdditionalSourceProviders(::ParcelizeUtilSourcesProvider)
|
||||
|
||||
useAdditionalService(service<JvmBoxMainClassProvider>(::ParcelizeMainClassProvider))
|
||||
|
||||
useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor)
|
||||
|
||||
enableMetaInfoHandler()
|
||||
}
|
||||
}
|
||||
|
||||
open class AbstractParcelizeBoxTest : AbstractParcelizeBoxTestBase<ClassicFrontendOutputArtifact, ClassicBackendInput>(
|
||||
FrontendKinds.ClassicFrontend,
|
||||
TargetBackend.JVM
|
||||
) {
|
||||
override val frontendFacade: Constructor<FrontendFacade<ClassicFrontendOutputArtifact>>
|
||||
get() = ::ClassicFrontendFacade
|
||||
|
||||
override val frontendToBackendConverter: Constructor<Frontend2BackendConverter<ClassicFrontendOutputArtifact, ClassicBackendInput>>
|
||||
get() = ::ClassicFrontend2ClassicBackendConverter
|
||||
|
||||
override val backendFacade: Constructor<BackendFacade<ClassicBackendInput, BinaryArtifacts.Jvm>>
|
||||
get() = ::ClassicJvmBackendFacade
|
||||
}
|
||||
|
||||
open class AbstractParcelizeIrBoxTest : AbstractParcelizeBoxTestBase<ClassicFrontendOutputArtifact, IrBackendInput>(
|
||||
FrontendKinds.ClassicFrontend,
|
||||
TargetBackend.JVM_IR
|
||||
) {
|
||||
override val frontendFacade: Constructor<FrontendFacade<ClassicFrontendOutputArtifact>>
|
||||
get() = ::ClassicFrontendFacade
|
||||
|
||||
override val frontendToBackendConverter: Constructor<Frontend2BackendConverter<ClassicFrontendOutputArtifact, IrBackendInput>>
|
||||
get() = ::ClassicFrontend2IrConverter
|
||||
|
||||
override val backendFacade: Constructor<BackendFacade<IrBackendInput, BinaryArtifacts.Jvm>>
|
||||
get() = ::JvmIrBackendFacade
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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.parcelize.test.runners
|
||||
|
||||
import org.jetbrains.kotlin.parcelize.test.services.ParcelizeEnvironmentConfigurator
|
||||
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
|
||||
import org.jetbrains.kotlin.test.directives.AsmLikeInstructionListingDirectives.IR_DIFFERENCE
|
||||
import org.jetbrains.kotlin.test.runners.codegen.AbstractAsmLikeInstructionListingTest
|
||||
import org.jetbrains.kotlin.test.runners.codegen.AbstractIrAsmLikeInstructionListingTest
|
||||
|
||||
open class AbstractParcelizeBytecodeListingTest : AbstractAsmLikeInstructionListingTest() {
|
||||
override fun configure(builder: TestConfigurationBuilder) {
|
||||
super.configure(builder)
|
||||
builder.configureParcelizeSpecific()
|
||||
}
|
||||
}
|
||||
|
||||
open class AbstractParcelizeIrBytecodeListingTest : AbstractIrAsmLikeInstructionListingTest() {
|
||||
override fun configure(builder: TestConfigurationBuilder) {
|
||||
super.configure(builder)
|
||||
builder.configureParcelizeSpecific()
|
||||
}
|
||||
}
|
||||
|
||||
private fun TestConfigurationBuilder.configureParcelizeSpecific() {
|
||||
defaultDirectives {
|
||||
+IR_DIFFERENCE
|
||||
}
|
||||
useConfigurators(::ParcelizeEnvironmentConfigurator)
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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.parcelize.test.runners
|
||||
|
||||
import com.intellij.testFramework.TestDataPath
|
||||
import org.jetbrains.kotlin.parcelize.test.services.SerializableLikeExtensionProvider
|
||||
import org.jetbrains.kotlin.test.TestMetadata
|
||||
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
@TestMetadata("plugins/parcelize/parcelize-compiler/testData/box")
|
||||
@TestDataPath("\$PROJECT_ROOT")
|
||||
class ParcelizeBoxTestWithSerializableLikeExtension : AbstractParcelizeBoxTest() {
|
||||
@Test
|
||||
@TestMetadata("simple.kt")
|
||||
fun testSimple() {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/simple.kt")
|
||||
}
|
||||
|
||||
override fun configure(builder: TestConfigurationBuilder) {
|
||||
super.configure(builder)
|
||||
builder.useConfigurators(::SerializableLikeExtensionProvider)
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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.parcelize.test.runners
|
||||
|
||||
import com.intellij.testFramework.TestDataPath
|
||||
import org.jetbrains.kotlin.parcelize.test.services.SerializableLikeExtensionProvider
|
||||
import org.jetbrains.kotlin.test.TestMetadata
|
||||
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
@TestMetadata("plugins/parcelize/parcelize-compiler/testData/box")
|
||||
@TestDataPath("\$PROJECT_ROOT")
|
||||
class ParcelizeIrBoxTestWithSerializableLikeExtension : AbstractParcelizeIrBoxTest() {
|
||||
@Test
|
||||
@TestMetadata("simple.kt")
|
||||
fun testSimple() {
|
||||
runTest("plugins/parcelize/parcelize-compiler/testData/box/simple.kt")
|
||||
}
|
||||
|
||||
override fun configure(builder: TestConfigurationBuilder) {
|
||||
super.configure(builder)
|
||||
builder.useConfigurators(::SerializableLikeExtensionProvider)
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* 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.parcelize.test.services
|
||||
|
||||
import com.intellij.openapi.project.Project
|
||||
import org.jetbrains.kotlin.cli.jvm.config.addJvmClasspathRoots
|
||||
import org.jetbrains.kotlin.config.CompilerConfiguration
|
||||
import org.jetbrains.kotlin.parcelize.ParcelizeComponentRegistrar
|
||||
import org.jetbrains.kotlin.test.model.TestModule
|
||||
import org.jetbrains.kotlin.test.services.EnvironmentConfigurator
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil
|
||||
import org.jetbrains.kotlin.utils.PathUtil
|
||||
import java.io.File
|
||||
|
||||
class ParcelizeEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfigurator(testServices) {
|
||||
override fun configureCompilerConfiguration(configuration: CompilerConfiguration, module: TestModule) {
|
||||
val runtimeLibrary = File(PathUtil.kotlinPathsForCompiler.libPath, PathUtil.PARCELIZE_RUNTIME_PLUGIN_JAR_NAME)
|
||||
val androidExtensionsRuntimeLibrary = File(PathUtil.kotlinPathsForCompiler.libPath, PathUtil.ANDROID_EXTENSIONS_RUNTIME_PLUGIN_JAR_NAME)
|
||||
val androidApiJar = KtTestUtil.findAndroidApiJar()
|
||||
configuration.addJvmClasspathRoots(listOf(runtimeLibrary, androidExtensionsRuntimeLibrary, androidApiJar))
|
||||
}
|
||||
|
||||
override fun registerCompilerExtensions(project: Project) {
|
||||
ParcelizeComponentRegistrar.registerParcelizeComponents(project)
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* 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.parcelize.test.services
|
||||
|
||||
import org.jetbrains.kotlin.parcelize.test.services.ParcelizeRuntimeClasspathProvider.Companion.JUNIT_GENERATED_TEST_CLASS_FQNAME
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
import org.jetbrains.kotlin.test.services.jvm.JvmBoxMainClassProvider
|
||||
import org.junit.runner.JUnitCore
|
||||
|
||||
class ParcelizeMainClassProvider(testServices: TestServices) : JvmBoxMainClassProvider(testServices) {
|
||||
override fun getMainClassNameAndAdditionalArguments(): List<String> {
|
||||
return listOf(
|
||||
JUnitCore::class.java.name,
|
||||
JUNIT_GENERATED_TEST_CLASS_FQNAME
|
||||
)
|
||||
}
|
||||
}
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* 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.parcelize.test.services
|
||||
|
||||
import org.jetbrains.kotlin.test.model.TestModule
|
||||
import org.jetbrains.kotlin.test.services.RuntimeClasspathProvider
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
import org.jetbrains.kotlin.test.services.jvm.compiledClassesManager
|
||||
import org.jetbrains.kotlin.test.services.temporaryDirectoryManager
|
||||
import org.jetbrains.kotlin.utils.PathUtil
|
||||
import org.jetbrains.org.objectweb.asm.ClassWriter
|
||||
import org.jetbrains.org.objectweb.asm.Label
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes
|
||||
import org.jetbrains.org.objectweb.asm.Type
|
||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
|
||||
import org.junit.runner.JUnitCore
|
||||
import java.io.File
|
||||
|
||||
class ParcelizeRuntimeClasspathProvider(testServices: TestServices) : RuntimeClasspathProvider(testServices) {
|
||||
companion object {
|
||||
val layoutlibJar: File by lazy { getLayoutLibFile("layoutlib(-jre[0-9]+)?") }
|
||||
val layoutlibApiJar: File by lazy { getLayoutLibFile("layoutlib-api") }
|
||||
|
||||
private const val ANDROID_TOOLS_PREFIX = "studio.android.sdktools."
|
||||
|
||||
private val androidPluginPath: String by lazy {
|
||||
System.getProperty("ideaSdk.androidPlugin.path")?.takeIf { File(it).isDirectory }
|
||||
?: throw RuntimeException("Unable to get a valid path from 'ideaSdk.androidPlugin.path' property, please point it to the Idea android plugin location")
|
||||
}
|
||||
|
||||
private fun getLayoutLibFile(pattern: String): File {
|
||||
val nameRegex = """^(${ANDROID_TOOLS_PREFIX})?$pattern-[0-9.]+\.jar$""".toRegex()
|
||||
return File(androidPluginPath).listFiles().orEmpty().singleOrNull { it.name.matches(nameRegex) }
|
||||
?: error(
|
||||
"""
|
||||
Can't find file for pattern $nameRegex in ${androidPluginPath}.
|
||||
Available files: ${File(androidPluginPath).list().orEmpty().asList()}
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
private val JUNIT_GENERATED_TEST_CLASS_BYTES by lazy { constructSyntheticTestClass() }
|
||||
private const val JUNIT_GENERATED_TEST_CLASS_PACKAGE = "test"
|
||||
private const val JUNIT_GENERATED_TEST_CLASS_NAME = "JunitTest.class"
|
||||
const val JUNIT_GENERATED_TEST_CLASS_FQNAME = "test.JunitTest"
|
||||
|
||||
private fun constructSyntheticTestClass(): ByteArray {
|
||||
return with(ClassWriter(ClassWriter.COMPUTE_MAXS or ClassWriter.COMPUTE_FRAMES)) {
|
||||
visit(49, Opcodes.ACC_PUBLIC, JUNIT_GENERATED_TEST_CLASS_FQNAME.replace('.', '/'), null, "java/lang/Object", emptyArray())
|
||||
visitSource(null, null)
|
||||
|
||||
with(visitAnnotation("Lorg/junit/runner/RunWith;", true)) {
|
||||
visit("value", Type.getType("Lorg/robolectric/RobolectricTestRunner;"))
|
||||
visitEnd()
|
||||
}
|
||||
|
||||
with(visitAnnotation("Lorg/robolectric/annotation/Config;", true)) {
|
||||
visit("sdk", intArrayOf(21))
|
||||
visit("manifest", "--none")
|
||||
visitEnd()
|
||||
}
|
||||
|
||||
with(visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null)) {
|
||||
visitVarInsn(Opcodes.ALOAD, 0)
|
||||
visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false)
|
||||
|
||||
visitInsn(Opcodes.RETURN)
|
||||
visitMaxs(-1, -1)
|
||||
visitEnd()
|
||||
}
|
||||
|
||||
with(visitMethod(Opcodes.ACC_PUBLIC, "test", "()V", null, null)) {
|
||||
visitAnnotation("Lorg/junit/Test;", true).visitEnd()
|
||||
|
||||
val v = InstructionAdapter(this)
|
||||
|
||||
val assertionOk = Label()
|
||||
|
||||
v.invokestatic("test/TestKt", "box", "()Ljava/lang/String;", false) // -> ret
|
||||
v.dup() // -> ret, ret
|
||||
v.aconst("OK") // -> ret, ret, ok
|
||||
v.invokevirtual("java/lang/String", "equals", "(Ljava/lang/Object;)Z", false) // -> ret, eq
|
||||
v.ifne(assertionOk) // -> ret
|
||||
|
||||
val assertionErrorType = Type.getObjectType("java/lang/AssertionError")
|
||||
|
||||
v.anew(assertionErrorType) // -> ret, ae
|
||||
v.dupX1() // -> ae, ret, ae
|
||||
v.swap() // -> ae, ae, ret
|
||||
v.invokespecial(assertionErrorType.internalName, "<init>", "(Ljava/lang/Object;)V", false) // -> ae
|
||||
v.athrow()
|
||||
|
||||
v.visitLabel(assertionOk)
|
||||
v.pop() // -> [empty]
|
||||
v.areturn(Type.VOID_TYPE)
|
||||
|
||||
visitMaxs(-1, -1)
|
||||
visitEnd()
|
||||
}
|
||||
|
||||
visitEnd()
|
||||
toByteArray()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun runtimeClassPaths(module: TestModule): List<File> {
|
||||
val kotlinRuntimeJar = PathUtil.kotlinPathsForIdeaPlugin.stdlibPath
|
||||
|
||||
val robolectricClasspath = System.getProperty("robolectric.classpath")
|
||||
?: throw RuntimeException("Unable to get a valid classpath from 'robolectric.classpath' property, please set it accordingly")
|
||||
val robolectricJars = robolectricClasspath.split(File.pathSeparator)
|
||||
.map { File(it) }
|
||||
.sortedBy { it.nameWithoutExtension }
|
||||
|
||||
val junitCoreResourceName = JUnitCore::class.java.name.replace('.', '/') + ".class"
|
||||
val junitJar = File(
|
||||
JUnitCore::class.java.classLoader.getResource(junitCoreResourceName)!!.file
|
||||
.substringAfter("file:")
|
||||
.substringBeforeLast('!')
|
||||
)
|
||||
|
||||
val parcelizeRuntimeJars = System.getProperty("parcelizeRuntime.classpath")?.split(File.pathSeparator)?.map(::File)
|
||||
?: error("Unable to get a valid classpath from 'parcelizeRuntime.classpath' property")
|
||||
|
||||
val tempDir = testServices.temporaryDirectoryManager.getOrCreateTempDirectory("additionalClassFiles")
|
||||
tempDir
|
||||
.resolve(JUNIT_GENERATED_TEST_CLASS_PACKAGE).also { it.mkdir() }
|
||||
.resolve(JUNIT_GENERATED_TEST_CLASS_NAME)
|
||||
.apply { writeBytes(JUNIT_GENERATED_TEST_CLASS_BYTES) }
|
||||
|
||||
return buildList {
|
||||
add(kotlinRuntimeJar)
|
||||
add(layoutlibJar)
|
||||
add(layoutlibApiJar)
|
||||
addAll(robolectricJars)
|
||||
add(junitJar)
|
||||
addAll(parcelizeRuntimeJars)
|
||||
add(tempDir)
|
||||
}
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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.parcelize.test.services
|
||||
|
||||
import org.jetbrains.kotlin.test.directives.model.RegisteredDirectives
|
||||
import org.jetbrains.kotlin.test.model.TestFile
|
||||
import org.jetbrains.kotlin.test.model.TestModule
|
||||
import org.jetbrains.kotlin.test.services.AdditionalSourceProvider
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
import java.io.File
|
||||
|
||||
class ParcelizeUtilSourcesProvider(testServices: TestServices, baseDir: String = ".") : AdditionalSourceProvider(testServices) {
|
||||
private val libraryPath = "$baseDir/plugins/parcelize/parcelize-compiler/testData/boxLib.kt"
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
override fun produceAdditionalFiles(globalDirectives: RegisteredDirectives, module: TestModule): List<TestFile> {
|
||||
return listOf(File(libraryPath).toTestFile())
|
||||
}
|
||||
}
|
||||
+8
-9
@@ -1,23 +1,22 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* 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.parcelize.test
|
||||
package org.jetbrains.kotlin.parcelize.test.services
|
||||
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
|
||||
import com.intellij.openapi.project.Project
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.extensions.SyntheticResolveExtension
|
||||
import org.jetbrains.kotlin.test.services.EnvironmentConfigurator
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
|
||||
class ParcelizeIrBoxTestWithSerializableLikeExtension : AbstractParcelizeIrBoxTest() {
|
||||
fun testSimple() = doTest("plugins/parcelize/parcelize-compiler/testData/box/simple.kt")
|
||||
|
||||
override fun setupEnvironment(environment: KotlinCoreEnvironment) {
|
||||
super.setupEnvironment(environment)
|
||||
SyntheticResolveExtension.registerExtension(environment.project, SerializableLike())
|
||||
class SerializableLikeExtensionProvider(testServices: TestServices) : EnvironmentConfigurator(testServices) {
|
||||
override fun registerCompilerExtensions(project: Project) {
|
||||
SyntheticResolveExtension.registerExtension(project, SerializableLike())
|
||||
}
|
||||
|
||||
private class SerializableLike : SyntheticResolveExtension {
|
||||
-22
@@ -1,22 +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.parcelize.test
|
||||
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
|
||||
import org.jetbrains.kotlin.cli.jvm.config.JvmClasspathRoot
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil
|
||||
import org.jetbrains.kotlin.utils.PathUtil
|
||||
import java.io.File
|
||||
|
||||
fun addParcelizeRuntimeLibrary(environment: KotlinCoreEnvironment) {
|
||||
val runtimeLibrary = File(PathUtil.kotlinPathsForCompiler.libPath, PathUtil.PARCELIZE_RUNTIME_PLUGIN_JAR_NAME)
|
||||
val androidExtensionsRuntimeLibrary = File(PathUtil.kotlinPathsForCompiler.libPath, PathUtil.ANDROID_EXTENSIONS_RUNTIME_PLUGIN_JAR_NAME)
|
||||
environment.updateClasspath(listOf(JvmClasspathRoot(runtimeLibrary), JvmClasspathRoot(androidExtensionsRuntimeLibrary)))
|
||||
}
|
||||
|
||||
fun addAndroidJarLibrary(environment: KotlinCoreEnvironment) {
|
||||
environment.updateClasspath(listOf(JvmClasspathRoot(KtTestUtil.findAndroidApiJar())))
|
||||
}
|
||||
Reference in New Issue
Block a user