[FIR-TEST] Add coroutines diagnostic tests from old FE to FIR test suite

This commit is contained in:
Dmitriy Novozhilov
2020-06-22 17:36:23 +03:00
parent d0affc6c6a
commit 6a9504f26a
159 changed files with 4638 additions and 26 deletions
@@ -53,6 +53,8 @@ public class SimpleTestClassModel extends TestClassModel {
private final String testRunnerMethodName;
private final List<String> additionalRunnerArguments;
private boolean skipTestsForExperimentalCoroutines;
public SimpleTestClassModel(
@NotNull File rootFile,
boolean recursive,
@@ -68,7 +70,8 @@ public class SimpleTestClassModel extends TestClassModel {
String testRunnerMethodName,
List<String> additionalRunnerArguments,
Integer deep,
@NotNull Collection<AnnotationModel> annotations
@NotNull Collection<AnnotationModel> annotations,
boolean skipTestsForExperimentalCoroutines
) {
this.rootFile = rootFile;
this.recursive = recursive;
@@ -85,6 +88,7 @@ public class SimpleTestClassModel extends TestClassModel {
this.additionalRunnerArguments = additionalRunnerArguments;
this.deep = deep;
this.annotations = annotations;
this.skipTestsForExperimentalCoroutines = skipTestsForExperimentalCoroutines;
}
@NotNull
@@ -104,7 +108,8 @@ public class SimpleTestClassModel extends TestClassModel {
children.add(new SimpleTestClassModel(
file, true, excludeParentDirs, filenamePattern, excludePattern, checkFilenameStartsLowerCase,
doTestMethodName, innerTestClassName, targetBackend, excludesStripOneDirectory(file.getName()),
skipIgnored, testRunnerMethodName, additionalRunnerArguments, deep != null ? deep - 1 : null, annotations)
skipIgnored, testRunnerMethodName, additionalRunnerArguments, deep != null ? deep - 1 : null, annotations,
skipTestsForExperimentalCoroutines)
);
}
@@ -156,7 +161,7 @@ public class SimpleTestClassModel extends TestClassModel {
if (CoroutinesKt.isCommonCoroutineTest(rootFile)) {
testMethods = CoroutinesKt.createCommonCoroutinesTestMethodModels(rootFile, rootFile, filenamePattern,
checkFilenameStartsLowerCase, targetBackend,
skipIgnored);
skipIgnored, skipTestsForExperimentalCoroutines);
}
else {
testMethods = Collections.singletonList(new SimpleTestMethodModel(
@@ -189,7 +194,8 @@ public class SimpleTestClassModel extends TestClassModel {
result.addAll(CoroutinesKt.createCommonCoroutinesTestMethodModels(rootFile, file,
filenamePattern,
checkFilenameStartsLowerCase,
targetBackend, skipIgnored));
targetBackend, skipIgnored,
skipTestsForExperimentalCoroutines));
}
else {
result.add(new SimpleTestMethodModel(rootFile, file, filenamePattern,
@@ -66,7 +66,8 @@ class TestGroup(
excludeDirs: List<String> = listOf(),
filenameStartsLowerCase: Boolean? = null,
skipIgnored: Boolean = false,
deep: Int? = null
deep: Int? = null,
skipTestsForExperimentalCoroutines: Boolean = false
) {
val rootFile = File("$testDataRoot/$relativeRootPath")
val compiledPattern = Pattern.compile(pattern)
@@ -83,7 +84,8 @@ class TestGroup(
SimpleTestClassModel(
rootFile, recursive, excludeParentDirs,
compiledPattern, compiledExcludedPattern, filenameStartsLowerCase, testMethod, className,
targetBackend, excludeDirs, skipIgnored, testRunnerMethodName, additionalRunnerArguments, deep, annotations
targetBackend, excludeDirs, skipIgnored, testRunnerMethodName, additionalRunnerArguments, deep, annotations,
skipTestsForExperimentalCoroutines
)
}
)
@@ -52,7 +52,8 @@ fun createCommonCoroutinesTestMethodModels(
filenamePattern: Pattern,
checkFilenameStartsLowerCase: Boolean?,
targetBackend: TargetBackend,
skipIgnored: Boolean
skipIgnored: Boolean,
skipExperimental: Boolean
): Collection<MethodModel> {
return if (targetBackend.isIR || targetBackend == TargetBackend.JS)
listOf(
@@ -66,8 +67,8 @@ fun createCommonCoroutinesTestMethodModels(
true
)
)
else
listOf(
else {
mutableListOf(
CoroutinesTestModel(
rootDir,
file,
@@ -76,15 +77,20 @@ fun createCommonCoroutinesTestMethodModels(
targetBackend,
skipIgnored,
true
),
CoroutinesTestModel(
rootDir,
file,
filenamePattern,
checkFilenameStartsLowerCase,
targetBackend,
skipIgnored,
false
)
)
).apply {
if (!skipExperimental) {
this += CoroutinesTestModel(
rootDir,
file,
filenamePattern,
checkFilenameStartsLowerCase,
targetBackend,
skipIgnored,
false
)
}
}
}
}