Fix BB test auto-generation (ignore backend FIR)

This commit is contained in:
Mikhail Glukhikh
2020-03-26 10:29:10 +03:00
parent aba7706dec
commit 547bb64b18
2 changed files with 12 additions and 3 deletions
@@ -72,9 +72,12 @@ public class GenerateRangesCodegenTestData {
private static final Map<String, String> MIN_MAX_CONSTANTS = new LinkedHashMap<>();
private static final List<String> FIR_PASSING_LITERAL_TESTS =
Arrays.asList("emptyDownto", "emptyRange", "oneElementDownTo", "oneElementRange", "openRange",
Arrays.asList("emptyDownto", "emptyRange", "inexactSteppedDownTo", "inexactSteppedRange",
"oneElementDownTo", "oneElementRange", "openRange",
"reversedBackSequence", "reversedEmptyBackSequence", "reversedEmptyRange",
"reversedRange", "simpleDownTo", "simpleRange", "simpleRangeWithNonConstantEnds");
"reversedInexactSteppedDownTo", "reversedRange", "reversedSimpleSteppedRange",
"simpleDownTo", "simpleRange", "simpleRangeWithNonConstantEnds",
"simpleSteppedDownTo", "simpleSteppedRange");
private static final List<String> FIR_PASSING_EXPRESSION_TESTS =
Arrays.asList("emptyDownto", "emptyRange", "inexactSteppedDownTo", "inexactSteppedRange",
"oneElementDownTo", "oneElementRange", "openRange",
@@ -147,6 +147,12 @@ object GenerateSteppedRangesCodegenTestData {
subdir: String? = null
) = listOf(true, false).forEach { generateTestsForFunction(fileName, typeToBuilderMap, function, extraCode, subdir, asLiteral = it) }
private val ignoredFrondendIRFiles = setOf(
"maxValueToMinValueStepMaxValue.kt", "maxValueToOneStepMaxValue.kt", "maxValueToZeroStepMaxValue.kt",
"minValueToMaxValueStepMaxValue.kt", "oneToMaxValueStepMaxValue.kt", "zeroToMaxValueStepMaxValue.kt",
"emptyProgressionToMinValue.kt"
)
private fun generateTestsForFunction(
fileName: String,
typeToBuilderMap: Map<Type, TestBuilder>,
@@ -164,7 +170,7 @@ object GenerateSteppedRangesCodegenTestData {
fullSubdir.mkdirs()
PrintWriter(File(fullSubdir, fileName)).use {
with(it) {
if (fullSubdirPath.contains("expression") || (fileName != "stepOne.kt" && fileName != "stepOneThenStepOne.kt")) {
if (fileName in ignoredFrondendIRFiles) {
println("// IGNORE_BACKEND_FIR: JVM_IR")
}
println("// $PREAMBLE_MESSAGE")