Add special tests for interceptRun support
Basically they're built upon basic coroutine tests, but for each of them different interceptResume implementation are injected (currently there are 12 of them). It might be more simple just to generated additional testData, but I see this more problematic in a sense of further maintenance Note that all tests add idempotent 'interceptRun' operators, which just execute given lambda in the current thread #KT-14891 Fixed
This commit is contained in:
@@ -863,13 +863,24 @@ public class KotlinTestUtils {
|
||||
assertTestClassPresentByMetadata(testCaseClass, file);
|
||||
}
|
||||
}
|
||||
else if (filenamePattern.matcher(file.getName()).matches() && isCompatibleTarget(targetBackend, file)) {
|
||||
else if (filenamePattern.matcher(file.getName()).matches() && isCompatibleTarget(targetBackend, file) &&
|
||||
!isThereCustomReasonToSkip(file, testCaseClass)) {
|
||||
assertFilePathPresent(file, rootFile, filePaths);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isThereCustomReasonToSkip(File file, Class<?> aClass) {
|
||||
if (!aClass.getSuperclass().getSimpleName().equals("AbstractAdditionalCoroutineBlackBoxCodegenTest")) return false;
|
||||
try {
|
||||
return InTextDirectivesUtils.isDirectiveDefined(FileUtil.loadFile(file), "// NO_INTERCEPT_RESUME_TESTS");
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void assertAllTestsPresentInSingleGeneratedClass(
|
||||
@NotNull Class<?> testCaseClass,
|
||||
@NotNull File testDataDir,
|
||||
|
||||
Reference in New Issue
Block a user