Send compiler output to stderr instead of stdout

Test only stderr in kotlinc test now and move the '-script' test to integration
tests where both stdout and stderr is tested
This commit is contained in:
Alexander Udalov
2014-07-22 16:14:49 +04:00
parent 7e6b05554e
commit 5003a2f570
14 changed files with 26 additions and 41 deletions
@@ -69,4 +69,8 @@ public class CompilerSmokeTest extends KotlinIntegrationTestBase {
runCompiler("test.compile", "-src", "test.kt", "-jar", jar);
}
@Test
public void simpleScript() throws Exception {
runCompiler("script", "-script", "script.kts", "hi", "there");
}
}
@@ -62,13 +62,18 @@ public abstract class KotlinIntegrationTestBase {
new File(getKotlinProjectHome(), "compiler" + File.separator + "integration-tests" + File.separator + "testData");
testDataDir = new File(baseTestDataDir, description.getMethodName());
}
};
static {
System.setProperty("java.awt.headless", "true");
}
protected int runCompiler(String logName, String... arguments) throws Exception {
File lib = getCompilerLib();
String classpath = lib.getAbsolutePath() + File.separator + "kotlin-compiler.jar";
String classpath = lib.getAbsolutePath() + File.separator +
"kotlin-compiler.jar" + File.pathSeparator +
getKotlinRuntimePath();
Collection<String> javaArgs = new ArrayList<String>();
javaArgs.add("-cp");
@@ -1,7 +1,6 @@
OUT:
ERROR: [TestData]/hello.kt: (4, 5) Unresolved reference: a
ERR:
ERROR: [TestData]/hello.kt: (4, 5) Unresolved reference: a
exec() finished with COMPILATION_ERROR return code
Return code: 1
@@ -0,0 +1,5 @@
OUT:
hi
there
Return code: 0
@@ -0,0 +1,3 @@
for (arg in args) {
println(arg)
}
@@ -1,7 +1,6 @@
OUT:
ERROR: [TestData]/test.kt: (4, 20) Expecting an element
ERR:
ERROR: [TestData]/test.kt: (4, 20) Expecting an element
exec() finished with COMPILATION_ERROR return code
Return code: 1