[Serialization] Migrate all tests to new test infrastructure

This commit is contained in:
Dmitriy Novozhilov
2022-08-24 17:33:39 +03:00
committed by teamcity
parent 4dd7437df1
commit a2ffba275c
47 changed files with 388 additions and 511 deletions
@@ -1,81 +0,0 @@
/*
* Copyright 2010-2022 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.kotlinx.serialization;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.kotlin.test.TargetBackend;
import org.jetbrains.kotlin.test.TestMetadata;
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 GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("plugins/kotlinx-serialization/testData/firMembers")
@TestDataPath("$PROJECT_ROOT")
public class SerializationFirBlackBoxTestGenerated extends AbstractSerializationFirBlackBoxTest {
@Test
@TestMetadata("abstractAndSealed.kt")
public void testAbstractAndSealed() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/abstractAndSealed.kt");
}
@Test
public void testAllFilesPresentInFirMembers() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/kotlinx-serialization/testData/firMembers"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("classWithCompanionObject.kt")
public void testClassWithCompanionObject() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/classWithCompanionObject.kt");
}
@Test
@TestMetadata("classWithGenericParameters.kt")
public void testClassWithGenericParameters() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/classWithGenericParameters.kt");
}
@Test
@TestMetadata("defaultProperties.kt")
public void testDefaultProperties() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/defaultProperties.kt");
}
@Test
@TestMetadata("enums.kt")
public void testEnums() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/enums.kt");
}
@Test
@TestMetadata("inlineClasses.kt")
public void testInlineClasses() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/inlineClasses.kt");
}
@Test
@TestMetadata("multipleProperties.kt")
public void testMultipleProperties() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/multipleProperties.kt");
}
@Test
@TestMetadata("privatePropertiesSerialization.kt")
public void testPrivatePropertiesSerialization() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/privatePropertiesSerialization.kt");
}
@Test
@TestMetadata("serializableObject.kt")
public void testSerializableObject() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/serializableObject.kt");
}
}
@@ -1,80 +0,0 @@
/*
* Copyright 2010-2022 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.kotlinx.serialization;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.kotlin.test.TestMetadata;
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 GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("plugins/kotlinx-serialization/testData/firMembers")
@TestDataPath("$PROJECT_ROOT")
public class SerializationFirMembersTestGenerated extends AbstractSerializationFirMembersTest {
@Test
@TestMetadata("abstractAndSealed.kt")
public void testAbstractAndSealed() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/abstractAndSealed.kt");
}
@Test
public void testAllFilesPresentInFirMembers() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/kotlinx-serialization/testData/firMembers"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("classWithCompanionObject.kt")
public void testClassWithCompanionObject() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/classWithCompanionObject.kt");
}
@Test
@TestMetadata("classWithGenericParameters.kt")
public void testClassWithGenericParameters() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/classWithGenericParameters.kt");
}
@Test
@TestMetadata("defaultProperties.kt")
public void testDefaultProperties() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/defaultProperties.kt");
}
@Test
@TestMetadata("enums.kt")
public void testEnums() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/enums.kt");
}
@Test
@TestMetadata("inlineClasses.kt")
public void testInlineClasses() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/inlineClasses.kt");
}
@Test
@TestMetadata("multipleProperties.kt")
public void testMultipleProperties() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/multipleProperties.kt");
}
@Test
@TestMetadata("privatePropertiesSerialization.kt")
public void testPrivatePropertiesSerialization() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/privatePropertiesSerialization.kt");
}
@Test
@TestMetadata("serializableObject.kt")
public void testSerializableObject() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/serializableObject.kt");
}
}
@@ -3,42 +3,41 @@
* 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.kotlinx.serialization;
package org.jetbrains.kotlinx.serialization.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/kotlinx-serialization/testData/codegen")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public class SerializationIrBytecodeListingTestGenerated extends AbstractSerializationIrBytecodeListingTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public class SerializationAsmLikeInstructionsListingTestGenerated extends AbstractSerializationAsmLikeInstructionsListingTest {
@Test
public void testAllFilesPresentInCodegen() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/kotlinx-serialization/testData/codegen"), Pattern.compile("^(.+)\\.kt$"), null, true);
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/kotlinx-serialization/testData/codegen"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@Test
@TestMetadata("Basic.kt")
public void testBasic() throws Exception {
runTest("plugins/kotlinx-serialization/testData/codegen/Basic.kt");
}
@Test
@TestMetadata("Delegated.kt")
public void testDelegated() throws Exception {
runTest("plugins/kotlinx-serialization/testData/codegen/Delegated.kt");
}
@Test
@TestMetadata("Sealed.kt")
public void testSealed() throws Exception {
runTest("plugins/kotlinx-serialization/testData/codegen/Sealed.kt");
@@ -0,0 +1,142 @@
/*
* Copyright 2010-2022 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.kotlinx.serialization.runners;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.kotlin.test.TargetBackend;
import org.jetbrains.kotlin.test.TestMetadata;
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 GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
public class SerializationFirBlackBoxTestGenerated extends AbstractSerializationFirBlackBoxTest {
@Nested
@TestMetadata("plugins/kotlinx-serialization/testData/boxIr")
@TestDataPath("$PROJECT_ROOT")
public class BoxIr {
@Test
public void testAllFilesPresentInBoxIr() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/kotlinx-serialization/testData/boxIr"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("annotationsOnFile.kt")
public void testAnnotationsOnFile() throws Exception {
runTest("plugins/kotlinx-serialization/testData/boxIr/annotationsOnFile.kt");
}
@Test
@TestMetadata("classSerializerAsObject.kt")
public void testClassSerializerAsObject() throws Exception {
runTest("plugins/kotlinx-serialization/testData/boxIr/classSerializerAsObject.kt");
}
@Test
@TestMetadata("enumsAreCached.kt")
public void testEnumsAreCached() throws Exception {
runTest("plugins/kotlinx-serialization/testData/boxIr/enumsAreCached.kt");
}
@Test
@TestMetadata("generics.kt")
public void testGenerics() throws Exception {
runTest("plugins/kotlinx-serialization/testData/boxIr/generics.kt");
}
@Test
@TestMetadata("inlineClasses.kt")
public void testInlineClasses() throws Exception {
runTest("plugins/kotlinx-serialization/testData/boxIr/inlineClasses.kt");
}
@Test
@TestMetadata("metaSerializable.kt")
public void testMetaSerializable() throws Exception {
runTest("plugins/kotlinx-serialization/testData/boxIr/metaSerializable.kt");
}
@Test
@TestMetadata("multimoduleInheritance.kt")
public void testMultimoduleInheritance() throws Exception {
runTest("plugins/kotlinx-serialization/testData/boxIr/multimoduleInheritance.kt");
}
@Test
@TestMetadata("sealedInterfaces.kt")
public void testSealedInterfaces() throws Exception {
runTest("plugins/kotlinx-serialization/testData/boxIr/sealedInterfaces.kt");
}
}
@Nested
@TestMetadata("plugins/kotlinx-serialization/testData/firMembers")
@TestDataPath("$PROJECT_ROOT")
public class FirMembers {
@Test
@TestMetadata("abstractAndSealed.kt")
public void testAbstractAndSealed() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/abstractAndSealed.kt");
}
@Test
public void testAllFilesPresentInFirMembers() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/kotlinx-serialization/testData/firMembers"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("classWithCompanionObject.kt")
public void testClassWithCompanionObject() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/classWithCompanionObject.kt");
}
@Test
@TestMetadata("classWithGenericParameters.kt")
public void testClassWithGenericParameters() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/classWithGenericParameters.kt");
}
@Test
@TestMetadata("defaultProperties.kt")
public void testDefaultProperties() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/defaultProperties.kt");
}
@Test
@TestMetadata("enums.kt")
public void testEnums() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/enums.kt");
}
@Test
@TestMetadata("inlineClasses.kt")
public void testInlineClasses() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/inlineClasses.kt");
}
@Test
@TestMetadata("multipleProperties.kt")
public void testMultipleProperties() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/multipleProperties.kt");
}
@Test
@TestMetadata("privatePropertiesSerialization.kt")
public void testPrivatePropertiesSerialization() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/privatePropertiesSerialization.kt");
}
@Test
@TestMetadata("serializableObject.kt")
public void testSerializableObject() throws Exception {
runTest("plugins/kotlinx-serialization/testData/firMembers/serializableObject.kt");
}
}
}
@@ -3,42 +3,41 @@
* 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.kotlinx.serialization;
package org.jetbrains.kotlinx.serialization.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/kotlinx-serialization/testData/codegen")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public class SerializationPluginBytecodeListingTestGenerated extends AbstractSerializationPluginBytecodeListingTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public class SerializationIrAsmLikeInstructionsListingTestGenerated extends AbstractSerializationIrAsmLikeInstructionsListingTest {
@Test
public void testAllFilesPresentInCodegen() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/kotlinx-serialization/testData/codegen"), Pattern.compile("^(.+)\\.kt$"), null, true);
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/kotlinx-serialization/testData/codegen"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("Basic.kt")
public void testBasic() throws Exception {
runTest("plugins/kotlinx-serialization/testData/codegen/Basic.kt");
}
@Test
@TestMetadata("Delegated.kt")
public void testDelegated() throws Exception {
runTest("plugins/kotlinx-serialization/testData/codegen/Delegated.kt");
}
@Test
@TestMetadata("Sealed.kt")
public void testSealed() throws Exception {
runTest("plugins/kotlinx-serialization/testData/codegen/Sealed.kt");
@@ -3,7 +3,7 @@
* 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.kotlinx.serialization;
package org.jetbrains.kotlinx.serialization.runners;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
@@ -3,112 +3,124 @@
* 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.kotlinx.serialization;
package org.jetbrains.kotlinx.serialization.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.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/kotlinx-serialization/testData/diagnostics")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public class SerializationPluginDiagnosticTestGenerated extends AbstractSerializationPluginDiagnosticTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@Test
public void testAllFilesPresentInDiagnostics() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/kotlinx-serialization/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), null, true);
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/kotlinx-serialization/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("DuplicateSerialName.kt")
public void testDuplicateSerialName() throws Exception {
runTest("plugins/kotlinx-serialization/testData/diagnostics/DuplicateSerialName.kt");
}
@Test
@TestMetadata("EnumDuplicateSerialName.kt")
public void testEnumDuplicateSerialName() throws Exception {
runTest("plugins/kotlinx-serialization/testData/diagnostics/EnumDuplicateSerialName.kt");
}
@Test
@TestMetadata("ExternalSerializers.kt")
public void testExternalSerializers() throws Exception {
runTest("plugins/kotlinx-serialization/testData/diagnostics/ExternalSerializers.kt");
}
@Test
@TestMetadata("IncorrectTransient.kt")
public void testIncorrectTransient() throws Exception {
runTest("plugins/kotlinx-serialization/testData/diagnostics/IncorrectTransient.kt");
}
@Test
@TestMetadata("IncorrectTransient2.kt")
public void testIncorrectTransient2() throws Exception {
runTest("plugins/kotlinx-serialization/testData/diagnostics/IncorrectTransient2.kt");
}
@Test
@TestMetadata("InheritableInfo.kt")
public void testInheritableInfo() throws Exception {
runTest("plugins/kotlinx-serialization/testData/diagnostics/InheritableInfo.kt");
}
@Test
@TestMetadata("LazyRecursionBug.kt")
public void testLazyRecursionBug() throws Exception {
runTest("plugins/kotlinx-serialization/testData/diagnostics/LazyRecursionBug.kt");
}
@Test
@TestMetadata("LocalAndAnonymous.kt")
public void testLocalAndAnonymous() throws Exception {
runTest("plugins/kotlinx-serialization/testData/diagnostics/LocalAndAnonymous.kt");
}
@Test
@TestMetadata("NoSuitableCtorInParent.kt")
public void testNoSuitableCtorInParent() throws Exception {
runTest("plugins/kotlinx-serialization/testData/diagnostics/NoSuitableCtorInParent.kt");
}
@Test
@TestMetadata("NonSerializable.kt")
public void testNonSerializable() throws Exception {
runTest("plugins/kotlinx-serialization/testData/diagnostics/NonSerializable.kt");
}
@Test
@TestMetadata("NullabilityIncompatible.kt")
public void testNullabilityIncompatible() throws Exception {
runTest("plugins/kotlinx-serialization/testData/diagnostics/NullabilityIncompatible.kt");
}
@Test
@TestMetadata("ParamIsNotProperty.kt")
public void testParamIsNotProperty() throws Exception {
runTest("plugins/kotlinx-serialization/testData/diagnostics/ParamIsNotProperty.kt");
}
@Test
@TestMetadata("SerializableEnums.kt")
public void testSerializableEnums() throws Exception {
runTest("plugins/kotlinx-serialization/testData/diagnostics/SerializableEnums.kt");
}
@Test
@TestMetadata("SerializableIgnored.kt")
public void testSerializableIgnored() throws Exception {
runTest("plugins/kotlinx-serialization/testData/diagnostics/SerializableIgnored.kt");
}
@Test
@TestMetadata("SerializerTypeCompatibleForSpecials.kt")
public void testSerializerTypeCompatibleForSpecials() throws Exception {
runTest("plugins/kotlinx-serialization/testData/diagnostics/SerializerTypeCompatibleForSpecials.kt");
}
@Test
@TestMetadata("SerializerTypeIncompatible.kt")
public void testSerializerTypeIncompatible() throws Exception {
runTest("plugins/kotlinx-serialization/testData/diagnostics/SerializerTypeIncompatible.kt");
}
@Test
@TestMetadata("Transients.kt")
public void testTransients() throws Exception {
runTest("plugins/kotlinx-serialization/testData/diagnostics/Transients.kt");
@@ -3,7 +3,7 @@
* 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.kotlinx.serialization;
package org.jetbrains.kotlinx.serialization.runners;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;