Remove LANGUAGE_VERSION from codegen tests on coroutines

Use `// !LANGUAGE: -ReleaseCoroutines` instead in tests which require
old (1.2) coroutines, and nothing in tests which require new coroutines
because master is already 1.3. Also remove superfluous API_VERSION and
other directives which have no effect anymore. Do not include runtime
automatically with `WITH_COROUTINES`/`COMMON_COROUTINES_TEST` in box
tests; require `WITH_RUNTIME` for that (majority of tests already had it
anyway), but remove it from bytecode text tests where runtime is always
added automatically. Fix the coroutine package selection code in
KotlinTestUtils and update the bunch files correspondingly.

Disable tests in `box/coroutines/noStdLib` on JVM: despite the name,
these tests were launched with stdlib because of the code in
CodegenTestCase, and they do not work without it because at least
CoroutineUtil.kt requires stdlib to compile correctly
This commit is contained in:
Alexander Udalov
2018-12-17 17:35:08 +01:00
parent 5b58eb8491
commit ec2dd58165
75 changed files with 173 additions and 324 deletions
@@ -7489,6 +7489,66 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class NoStdLib extends AbstractLightAnalysisModeTest {
@TestMetadata("breakFinally.kt")
public void ignoreBreakFinally_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/breakFinally.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("breakFinally.kt")
public void ignoreBreakFinally_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/breakFinally.kt", "kotlin.coroutines");
}
@TestMetadata("breakStatement.kt")
public void ignoreBreakStatement_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/breakStatement.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("breakStatement.kt")
public void ignoreBreakStatement_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/breakStatement.kt", "kotlin.coroutines");
}
@TestMetadata("crossinline.kt")
public void ignoreCrossinline_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/crossinline.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("crossinline.kt")
public void ignoreCrossinline_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/crossinline.kt", "kotlin.coroutines");
}
@TestMetadata("ifStatement.kt")
public void ignoreIfStatement_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/ifStatement.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("ifStatement.kt")
public void ignoreIfStatement_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/ifStatement.kt", "kotlin.coroutines");
}
@TestMetadata("stateMachine.kt")
public void ignoreStateMachine_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/stateMachine.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("stateMachine.kt")
public void ignoreStateMachine_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/stateMachine.kt", "kotlin.coroutines");
}
@TestMetadata("switchLikeWhen.kt")
public void ignoreSwitchLikeWhen_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/switchLikeWhen.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("switchLikeWhen.kt")
public void ignoreSwitchLikeWhen_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/switchLikeWhen.kt", "kotlin.coroutines");
}
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
@@ -7500,66 +7560,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
public void testAllFilesPresentInNoStdLib() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/coroutines/noStdLib"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("breakFinally.kt")
public void testBreakFinally_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/breakFinally.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("breakFinally.kt")
public void testBreakFinally_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/breakFinally.kt", "kotlin.coroutines");
}
@TestMetadata("breakStatement.kt")
public void testBreakStatement_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/breakStatement.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("breakStatement.kt")
public void testBreakStatement_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/breakStatement.kt", "kotlin.coroutines");
}
@TestMetadata("crossinline.kt")
public void testCrossinline_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/crossinline.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("crossinline.kt")
public void testCrossinline_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/crossinline.kt", "kotlin.coroutines");
}
@TestMetadata("ifStatement.kt")
public void testIfStatement_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/ifStatement.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("ifStatement.kt")
public void testIfStatement_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/ifStatement.kt", "kotlin.coroutines");
}
@TestMetadata("stateMachine.kt")
public void testStateMachine_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/stateMachine.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("stateMachine.kt")
public void testStateMachine_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/stateMachine.kt", "kotlin.coroutines");
}
@TestMetadata("switchLikeWhen.kt")
public void testSwitchLikeWhen_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/switchLikeWhen.kt", "kotlin.coroutines.experimental");
}
@TestMetadata("switchLikeWhen.kt")
public void testSwitchLikeWhen_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/codegen/box/coroutines/noStdLib/switchLikeWhen.kt", "kotlin.coroutines");
}
}
@TestMetadata("compiler/testData/codegen/box/coroutines/redundantLocalsElimination")