DryRun mode for GenerateTests is added

Relates to #KTI-17
This commit is contained in:
Vladimir Dolzhenko
2020-06-08 19:05:10 +00:00
parent cd9273028b
commit 9319c4c96e
13 changed files with 5139 additions and 5018 deletions
@@ -6,13 +6,24 @@
package org.jetbrains.kotlin.pill.generateAllTests;
import org.jetbrains.kotlin.generators.tests.*;
import org.jetbrains.kotlin.generators.tests.generator.InconsistencyChecker;
import java.util.List;
public class Main {
public static void main(String[] args) {
GenerateCompilerTestsKt.main();
GenerateTestsKt.main();
GenerateJsTestsKt.main();
GenerateJava8TestsKt.main();
GenerateRuntimeDescriptorTestsKt.main();
GenerateCompilerTestsKt.main(args);
GenerateTestsKt.main(args);
GenerateJsTestsKt.main(args);
GenerateJava8TestsKt.main(args);
GenerateRuntimeDescriptorTestsKt.main(args);
boolean dryRun = InconsistencyChecker.Companion.hasDryRunArg(args);
List<String> affectedFiles = InconsistencyChecker.Companion.inconsistencyChecker(dryRun).getAffectedFiles();
int size = affectedFiles.size();
if (size > 0) {
throw new IllegalStateException("There " + (size == 1 ? "is a test" : "are " + size + " tests") + " to be regenerated:\n"
+ String.join("\n", affectedFiles));
}
}
}