use of org.eclipse.ceylon.compiler.java.launcher.Main.ExitState in project ceylon by eclipse.
the class IssuesTests_1500_1999 method testBug1836.
@Test
public void testBug1836() {
ErrorCollector collector = new ErrorCollector();
CeyloncTaskImpl task = getCompilerTask(defaultOptions, collector, "bug18xx/Bug1836.ceylon");
ExitState call2 = task.call2();
Assert.assertEquals(CeylonState.ERROR, call2.ceylonState);
Assert.assertEquals(Main.EXIT_ERROR, call2.javacExitCode.exitCode);
}
use of org.eclipse.ceylon.compiler.java.launcher.Main.ExitState in project ceylon by eclipse.
the class IssuesTests_1500_1999 method testBug1773.
@Test
public void testBug1773() {
ErrorCollector collector = new ErrorCollector();
CeyloncTaskImpl task = getCompilerTask(defaultOptions, collector, "bug17xx/Bug1773.ceylon");
// now compile it all the way
ExitState exitState = task.call2();
Assert.assertEquals(ExitState.CeylonState.ERROR, exitState.ceylonState);
// make sure we only got one, do not trust actualErrors.size() for that since it's a Set so
// two methods with same contents would count as one.
Assert.assertEquals(1, exitState.errorCount);
TreeSet<CompilerError> actualErrors = collector.get(Diagnostic.Kind.ERROR);
compareErrors(actualErrors, new CompilerError(22, "dynamic is not supported on the JVM"));
}
use of org.eclipse.ceylon.compiler.java.launcher.Main.ExitState in project ceylon by eclipse.
the class IssuesTests_6500_6999 method testBug6592.
@Test
public void testBug6592() {
CompilationAssertion expectSysError = new CompilationAssertion() {
public void onError(ErrorCollector collector, ExitState exitState) {
TreeSet<CompilerError> treeSet = collector.get(Kind.ERROR);
assertEquals(1, treeSet.size());
CompilerError e = treeSet.iterator().next();
assertTrue(e.message.contains("No such overrides file: "));
assertTrue(e.message.contains("doesNotExist.xml"));
}
};
assertCompiles(Arrays.asList("-overrides", "doesNotExist.xml"), new String[] { "bug65xx/bug6592/bug6592.ceylon" }, expectSysError);
expectSysError = new CompilationAssertion() {
public void onError(ErrorCollector collector, ExitState exitState) {
TreeSet<CompilerError> treeSet = collector.get(Kind.ERROR);
assertEquals(1, treeSet.size());
CompilerError e = treeSet.iterator().next();
assertTrue(e.message.contains("overrides.xml:2:12: Missing 'module' attribute in element [module: null]."));
}
};
assertCompiles(Arrays.asList("-overrides", "test/src/org/eclipse/ceylon/compiler/java/test/issues/bug65xx/bug6592/overrides.xml"), new String[] { "bug65xx/bug6592/bug6592.ceylon" }, expectSysError);
}
use of org.eclipse.ceylon.compiler.java.launcher.Main.ExitState in project ceylon by eclipse.
the class CompilerTests method compilesWithoutWarnings.
protected void compilesWithoutWarnings(List<String> options, String... ceylon) {
ErrorCollector dl = new ErrorCollector();
ExitState exitState = getCompilerTask(options, dl, ceylon).call2();
Assert.assertEquals(exitState.ceylonState, CeylonState.OK);
Assert.assertEquals("The code compiled with javac warnings", 0, dl.get(Diagnostic.Kind.WARNING).size() + dl.get(Diagnostic.Kind.MANDATORY_WARNING).size());
}
use of org.eclipse.ceylon.compiler.java.launcher.Main.ExitState in project ceylon by eclipse.
the class RecoveryTests method bug6290.
@Test
public void bug6290() {
String[] src = new String[] { "bug6290/Bug6290.java", "bug6290/module.ceylon" };
ExitState result = getCompilerTask(defaultOptions, null, src).call2();
Assert.assertEquals(Main.Result.ABNORMAL, result.javacExitCode);
Assert.assertEquals(CeylonState.ERROR, result.ceylonState);
}
Aggregations