Use TargetBackend.ANY as default parameter and migrate to more generic runTest method

This commit is contained in:
Nikolay Krasko
2019-10-18 13:37:59 +03:00
parent 3891f9fcaa
commit 98ac2af402
4 changed files with 70 additions and 15 deletions
@@ -707,6 +707,11 @@ public class KotlinTestUtils {
void invoke(@NotNull String filePath) throws Exception;
}
@SuppressWarnings("unused")
public static void runTest(@NotNull DoTest test, @NotNull TestCase testCase, @TestDataFile String testDataFile) throws Exception {
runTest(test, TargetBackend.ANY, testDataFile);
}
// In this test runner version the `testDataFile` parameter is annotated by `TestDataFile`.
// So only file paths passed to this parameter will be used in navigation actions, like "Navigate to testdata" and "Related Symbol..."
public static void runTest(DoTest test, TargetBackend targetBackend, @TestDataFile String testDataFile) throws Exception {
@@ -828,6 +833,23 @@ public class KotlinTestUtils {
}
}
public static void assertAllTestsPresentByMetadata(
@NotNull Class<?> testCaseClass,
@NotNull File testDataDir,
@NotNull Pattern filenamePattern,
boolean recursive,
@NotNull String... excludeDirs
) {
assertAllTestsPresentByMetadata(
testCaseClass,
testDataDir,
filenamePattern,
TargetBackend.ANY,
recursive,
excludeDirs
);
}
public static void assertAllTestsPresentByMetadata(
@NotNull Class<?> testCaseClass,
@NotNull File testDataDir,
@@ -856,6 +878,14 @@ public class KotlinTestUtils {
}
}
public static void assertAllTestsPresentInSingleGeneratedClass(
@NotNull Class<?> testCaseClass,
@NotNull File testDataDir,
@NotNull Pattern filenamePattern
) {
assertAllTestsPresentInSingleGeneratedClass(testCaseClass, testDataDir, filenamePattern, TargetBackend.ANY);
}
public static void assertAllTestsPresentInSingleGeneratedClass(
@NotNull Class<?> testCaseClass,
@NotNull File testDataDir,