CLI tests: rename CliBaseTest to AbstractCliTest

This commit is contained in:
Alexander Udalov
2016-02-08 21:25:14 +05:30
committed by Alexander Udalov
parent 762504d5e4
commit a53166b732
6 changed files with 19 additions and 19 deletions
@@ -45,7 +45,7 @@ import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
public abstract class CliBaseTest extends TestCaseWithTmpdir {
public abstract class AbstractCliTest extends TestCaseWithTmpdir {
static final String JS_TEST_DATA = "compiler/testData/cli/js";
static final String JVM_TEST_DATA = "compiler/testData/cli/jvm";
@@ -34,7 +34,7 @@ public abstract class AbstractKotlincExecutableTest extends TestCaseWithTmpdir {
File kotlincFile = new File(PathUtil.getKotlinPathsForDistDirectory().getHomePath(), "bin/" + executableFileName);
assertTrue("kotlinc executable not found, probably you need to invoke 'dist' Ant target: " + kotlincFile.getAbsolutePath(), kotlincFile.exists());
List<String> args = CliBaseTest.readArgs(argsFilePath, testDataDir, tmpdir.getAbsolutePath());
List<String> args = AbstractCliTest.readArgs(argsFilePath, testDataDir, tmpdir.getAbsolutePath());
args.add(0, kotlincFile.getAbsolutePath());
ProcessOutput processOutput = ExecUtil.execAndGetOutput(args, null);
@@ -42,7 +42,7 @@ public abstract class AbstractKotlincExecutableTest extends TestCaseWithTmpdir {
String stderr = processOutput.getStderr();
int exitCode = processOutput.getExitCode();
String normalizedOutput = CliBaseTest.getNormalizedCompilerOutput(stderr, ExitCode.values()[exitCode], testDataDir);
String normalizedOutput = AbstractCliTest.getNormalizedCompilerOutput(stderr, ExitCode.values()[exitCode], testDataDir);
File outFile = new File(argsFilePath.replace(".args", ".out"));
try {
@@ -58,10 +58,10 @@ public abstract class AbstractKotlincExecutableTest extends TestCaseWithTmpdir {
}
protected void doJvmTest(@NotNull String argsFilePath) throws Exception {
doTest(argsFilePath, "kotlinc-jvm", CliBaseTest.JVM_TEST_DATA);
doTest(argsFilePath, "kotlinc-jvm", AbstractCliTest.JVM_TEST_DATA);
}
protected void doJsTest(@NotNull String argsFilePath) throws Exception {
doTest(argsFilePath, "kotlinc-js", CliBaseTest.JS_TEST_DATA);
doTest(argsFilePath, "kotlinc-js", AbstractCliTest.JS_TEST_DATA);
}
}
@@ -45,7 +45,7 @@ class WrongBytecodeVersionTest : UsefulTestCase() {
changeVersionInBytecode(classFile)
}
val (output, exitCode) = CliBaseTest.executeCompilerGrabOutput(K2JVMCompiler(), listOf(
val (output, exitCode) = AbstractCliTest.executeCompilerGrabOutput(K2JVMCompiler(), listOf(
usageSource.path,
"-classpath", tmpdir.path,
"-d", tmpdir.path
@@ -53,7 +53,7 @@ class WrongBytecodeVersionTest : UsefulTestCase() {
assertEquals("Compilation error expected", ExitCode.COMPILATION_ERROR, exitCode)
val normalized = CliBaseTest.getNormalizedCompilerOutput(output, exitCode, tmpdir.path, JvmBytecodeBinaryVersion.INSTANCE)
val normalized = AbstractCliTest.getNormalizedCompilerOutput(output, exitCode, tmpdir.path, JvmBytecodeBinaryVersion.INSTANCE)
KotlinTestUtils.assertEqualsToFile(File(directory, "output.txt"), normalized)
}
@@ -16,9 +16,9 @@
package org.jetbrains.kotlin.cli.js;
import org.jetbrains.kotlin.cli.CliBaseTest;
import org.jetbrains.kotlin.cli.AbstractCliTest;
public class K2JsCliTest extends CliBaseTest {
public class K2JsCliTest extends AbstractCliTest {
public void testSimple2js() throws Exception {
executeCompilerCompareOutputJS();
}
@@ -16,9 +16,9 @@
package org.jetbrains.kotlin.cli.jvm;
import org.jetbrains.kotlin.cli.CliBaseTest;
import org.jetbrains.kotlin.cli.AbstractCliTest;
public class K2JvmCliTest extends CliBaseTest {
public class K2JvmCliTest extends AbstractCliTest {
public void testWrongAbiVersion() throws Exception {
executeCompilerCompareOutputJVM();
}