CLI tests: add LauncherScriptTest instead of generated 'kotlinc' script tests

The compiler behavior on test data in compiler/testData/cli is already tested
with CliTestGenerated, which is 4x faster and does not require to rebuild the
compiler jar with 'ant dist'. Leave only several simple tests to check that
'kotlinc', 'kotlinc-jvm' and 'kotlinc-js' scripts work
This commit is contained in:
Alexander Udalov
2016-02-09 10:19:41 +05:30
committed by Alexander Udalov
parent 04ccca8adc
commit 35a4aeeeba
8 changed files with 101 additions and 491 deletions
@@ -63,11 +63,6 @@ public abstract class AbstractCliTest extends TestCaseWithTmpdir {
}
}
@NotNull
public static String getNormalizedCompilerOutput(@NotNull String pureOutput, @NotNull ExitCode exitCode, @NotNull String testDataDir) {
return getNormalizedCompilerOutput(pureOutput, exitCode, testDataDir, JvmMetadataVersion.INSTANCE);
}
@NotNull
public static String getNormalizedCompilerOutput(
@NotNull String pureOutput,
@@ -88,8 +83,9 @@ public abstract class AbstractCliTest extends TestCaseWithTmpdir {
private void doTest(@NotNull String fileName, @NotNull CLICompiler<?> compiler) throws Exception {
System.setProperty("java.awt.headless", "true");
Pair<String, ExitCode> outputAndExitCode = executeCompilerGrabOutput(compiler, readArgs(fileName, tmpdir.getPath()));
String actual =
getNormalizedCompilerOutput(outputAndExitCode.getFirst(), outputAndExitCode.getSecond(), new File(fileName).getParent());
String actual = getNormalizedCompilerOutput(
outputAndExitCode.getFirst(), outputAndExitCode.getSecond(), new File(fileName).getParent(), JvmMetadataVersion.INSTANCE
);
File outFile = new File(fileName.replaceFirst("\\.args$", ".out"));
KotlinTestUtils.assertEqualsToFile(outFile, actual);