use of com.redhat.ceylon.compiler.java.test.ErrorCollector in project ceylon-compiler by ceylon.
the class IssuesTests_1500_1999 method testBug1631.
@Ignore("Used for benchmarking")
@Test
public void testBug1631() throws Exception {
// System.err.println("Press enter to continue");
// System.in.read();
// System.err.println("Let's go");
long totals = 0;
int runs = 1;
for (int i = 0; i < runs; i++) {
long start = System.nanoTime();
ErrorCollector c = new ErrorCollector();
assertCompilesOk(c, getCompilerTask(Arrays.asList(/*"-verbose:benchmark", */
"-out", destDir), c, "bug16xx/bug1631/run.ceylon").call2());
// benchmarkParse("bug16xx/bug1631/run.ceylon");
long end = System.nanoTime();
long total = end - start;
System.err.println("Took " + (total / 1_000_000) + "ms");
totals += total;
}
System.err.println("Average " + ((totals / 1_000_000) / runs) + "ms");
// System.err.println("Press enter to quit");
// System.in.read();
// System.err.println("Done");
}
use of com.redhat.ceylon.compiler.java.test.ErrorCollector in project ceylon-compiler by ceylon.
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);
}
use of com.redhat.ceylon.compiler.java.test.ErrorCollector in project ceylon-compiler by ceylon.
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 com.redhat.ceylon.compiler.java.test.ErrorCollector in project ceylon-compiler by ceylon.
the class IssuesTests_1500_1999 method testBug1830.
@Test
public void testBug1830() {
ErrorCollector collector = new ErrorCollector();
CeyloncTaskImpl task = getCompilerTask(defaultOptions, collector, "bug18xx/Bug1830.ceylon");
ExitState call2 = task.call2();
Assert.assertEquals(CeylonState.ERROR, call2.ceylonState);
Assert.assertEquals(Main.EXIT_ERROR, call2.javacExitCode);
}
use of com.redhat.ceylon.compiler.java.test.ErrorCollector in project ceylon-compiler by ceylon.
the class IssuesTests_1000_1499 method testBug1347.
@Test
public void testBug1347() {
Assume.assumeTrue("Runs on JDK8", JDKUtils.jdk == JDKUtils.JDK.JDK8);
assertErrors("bug13xx/bug1347/bug1347", Arrays.asList("-out", destDir, "-rep", "test/java8/modules"), null, new CompilerError(12, "call to a static interface member is not allowed unless you set the -target flag to 8: --javac=-target=8"), new CompilerError(14, "call to a static interface member is not allowed unless you set the -target flag to 8: --javac=-target=8"), new CompilerError(16, "call to a static interface member is not allowed unless you set the -target flag to 8: --javac=-target=8"), new CompilerError(28, "call to a static interface member is not allowed unless you set the -target flag to 8: --javac=-target=8"), new CompilerError(30, "call to a static interface member is not allowed unless you set the -target flag to 8: --javac=-target=8"));
ErrorCollector c = new ErrorCollector();
assertCompilesOk(c, getCompilerTask(Arrays.asList("-target", "8", "-out", destDir, "-rep", "test/java8/modules"), c, "bug13xx/bug1347/bug1347.ceylon").call2());
run("com.redhat.ceylon.compiler.java.test.issues.bug13xx.bug1347.test", new ModuleWithArtifact("com.redhat.ceylon.compiler.java.test.issues.bug13xx.bug1347", "1"), new ModuleWithArtifact("com.ceylon.java8", "1", "test/java8/modules", "jar"));
}
Aggregations