Don't check exit code in Ant tests

It's already checked in the build log in each test
This commit is contained in:
Alexander Udalov
2015-06-03 13:48:19 +03:00
parent 89408f45bb
commit 968d362b77
3 changed files with 13 additions and 22 deletions
@@ -21,16 +21,18 @@ import org.jetbrains.kotlin.cli.CliBaseTest;
import java.io.File;
import static org.junit.Assert.assertEquals;
public abstract class AntTaskBaseTest extends KotlinIntegrationTestBase {
protected static final File ANT_TASK_TEST_DATA_BASE_DIR = new File(INTEGRATION_TEST_DATA_BASE_DIR, "ant");
protected static final int SUCCESSFUL = 0;
protected static final int FAILED = 1;
protected void doAntTest(int expectedExitCode) throws Exception {
assertEquals("Compilation failed", expectedExitCode, runAnt("build.log", "build.xml"));
protected void doAntTest() throws Exception {
runJava(
"build.log",
"-jar", getAntHome() + File.separator + "lib" + File.separator + "ant-launcher.jar",
"-Dkotlin.lib=" + getCompilerLib(),
"-Dtest.data=" + getTestDataDir(),
"-Dtemp=" + tmpdir.getTmpDir(),
"-f", "build.xml"
);
}
@Override
@@ -39,17 +41,6 @@ public abstract class AntTaskBaseTest extends KotlinIntegrationTestBase {
.replaceAll("Total time: .+\n", "Total time: [time]\n");
}
private int runAnt(@NotNull String logName, @NotNull String scriptName) throws Exception {
return runJava(
logName,
"-jar", getAntHome() + File.separator + "lib" + File.separator + "ant-launcher.jar",
"-Dkotlin.lib=" + getCompilerLib(),
"-Dtest.data=" + getTestDataDir(),
"-Dtemp=" + tmpdir.getTmpDir(),
"-f", scriptName
);
}
@NotNull
private static String getAntHome() {
return getKotlinProjectHome().getAbsolutePath() + File.separator + "dependencies" + File.separator + "ant-1.8";
@@ -48,7 +48,7 @@ public class AntTaskJsTest extends AntTaskBaseTest {
}
private void doJsAntTest(String... jsFiles) throws Exception {
doAntTest(SUCCESSFUL);
doAntTest();
List<String> fileNames = new ArrayList<String>(Arrays.asList(jsFiles));
fileNames.add(JS_OUT_FILE);
@@ -179,12 +179,12 @@ public class AntTaskJsTest extends AntTaskBaseTest {
@Test
public void noSrcParam() throws Exception {
doAntTest(FAILED);
doAntTest();
}
@Test
public void noOutputParam() throws Exception {
doAntTest(FAILED);
doAntTest();
}
@Test
@@ -39,7 +39,7 @@ public class AntTaskJvmTest extends AntTaskBaseTest {
}
private void doJvmAntTest() throws Exception {
doAntTest(SUCCESSFUL);
doAntTest();
String classpath = UtilsPackage.join(Arrays.asList(
getOutputFileByName(JVM_OUT_FILE).getAbsolutePath(),