Add bytecode text tests for ForLoopsLowering.

This commit is contained in:
Mark Punzalan
2019-06-21 23:06:26 -07:00
committed by max-kammerer
parent 277cb39e3b
commit 9bb9ab67a7
18 changed files with 750 additions and 3 deletions
@@ -2157,6 +2157,19 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilLongMinValue.kt");
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/stepped")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Stepped extends AbstractBytecodeTextTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInStepped() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/stepped"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/hashCode")
@@ -2127,6 +2127,94 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest {
runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilWithMixedTypeBoundsNoBoundCheckNeededForLongRangeIR.kt");
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/stepped")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Stepped extends AbstractIrBytecodeTextTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInStepped() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/stepped"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
}
@TestMetadata("emptyUntilProgressionToMinValue.kt")
public void testEmptyUntilProgressionToMinValue() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/emptyUntilProgressionToMinValue.kt");
}
@TestMetadata("illegalStepConst.kt")
public void testIllegalStepConst() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/illegalStepConst.kt");
}
@TestMetadata("reversedThenStep.kt")
public void testReversedThenStep() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/reversedThenStep.kt");
}
@TestMetadata("stepConst.kt")
public void testStepConst() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepConst.kt");
}
@TestMetadata("stepConstOnNonLiteralProgression.kt")
public void testStepConstOnNonLiteralProgression() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepConstOnNonLiteralProgression.kt");
}
@TestMetadata("stepNonConst.kt")
public void testStepNonConst() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepNonConst.kt");
}
@TestMetadata("stepNonConstOnNonLiteralProgression.kt")
public void testStepNonConstOnNonLiteralProgression() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepNonConstOnNonLiteralProgression.kt");
}
@TestMetadata("stepOne.kt")
public void testStepOne() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepOne.kt");
}
@TestMetadata("stepOneThenStepOne.kt")
public void testStepOneThenStepOne() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepOneThenStepOne.kt");
}
@TestMetadata("stepThenDifferentStep.kt")
public void testStepThenDifferentStep() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepThenDifferentStep.kt");
}
@TestMetadata("stepThenReversed.kt")
public void testStepThenReversed() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepThenReversed.kt");
}
@TestMetadata("stepThenSameStep.kt")
public void testStepThenSameStep() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepThenSameStep.kt");
}
@TestMetadata("stepThenStepNonConst.kt")
public void testStepThenStepNonConst() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepThenStepNonConst.kt");
}
@TestMetadata("stepThenStepOne.kt")
public void testStepThenStepOne() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepThenStepOne.kt");
}
@TestMetadata("untilProgressionToNonConst.kt")
public void testUntilProgressionToNonConst() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/untilProgressionToNonConst.kt");
}
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/hashCode")