Generate IGNORE_BACKEND_FIR in black box tests properly

This commit is contained in:
Mikhail Glukhikh
2020-02-20 18:11:00 +03:00
parent d921dd0eed
commit 01053c938a
3 changed files with 14 additions and 4 deletions
@@ -23,7 +23,12 @@ object GenerateInRangeExpressionTestData {
header: String = ""
) {
PrintWriter(File(GENERATED_DIR, fileName)).use {
it.generateTestCaseBody(header, rangeExpressions, elementExpressions, ignoreFrontendIR = (fileName != "charRangeLiteral.kt"))
it.generateTestCaseBody(
header, rangeExpressions, elementExpressions,
ignoreFrontendIR = fileName !in listOf(
"charRangeLiteral.kt", "charDownTo.kt", "charUntil.kt", "intDownTo.kt", "longDownTo.kt"
)
)
}
}
@@ -227,8 +227,11 @@ public class GenerateRangesCodegenTestData {
}
String fileName = testFunName + ".kt";
writeToFile(new File(AS_LITERAL_DIR, fileName), asLiteralBody.toString(), false, true);
writeToFile(new File(AS_EXPRESSION_DIR, fileName), asExpressionBody.toString(), false, true);
boolean useFrontendIR =
testFunName.equals("emptyDownto") || testFunName.equals("emptyRange") ||
testFunName.equals("reversedEmptyRange") || testFunName.equals("reversedEmptyBackSequence");
writeToFile(new File(AS_LITERAL_DIR, fileName), asLiteralBody.toString(), false, !useFrontendIR);
writeToFile(new File(AS_EXPRESSION_DIR, fileName), asExpressionBody.toString(), false, !useFrontendIR);
writeToFile(new File(UNSIGNED_AS_LITERAL_DIR, fileName), unsignedAsLiteralBody.toString(), true, true);
writeToFile(new File(UNSIGNED_AS_EXPRESSION_DIR, fileName), unsignedAsExpressionBody.toString(), true, true);
}
@@ -164,7 +164,9 @@ object GenerateSteppedRangesCodegenTestData {
fullSubdir.mkdirs()
PrintWriter(File(fullSubdir, fileName)).use {
with(it) {
println("// IGNORE_BACKEND_FIR: JVM_IR")
if (fullSubdirPath.contains("expression") || (fileName != "stepOne.kt" && fileName != "stepOneThenStepOne.kt")) {
println("// IGNORE_BACKEND_FIR: JVM_IR")
}
println("// $PREAMBLE_MESSAGE")
println("// KJS_WITH_FULL_RUNTIME")
println("// WITH_RUNTIME")