use of com.redhat.ceylon.compiler.java.tools.CeyloncTaskImpl 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.tools.CeyloncTaskImpl 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.tools.CeyloncTaskImpl 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.tools.CeyloncTaskImpl in project ceylon-compiler by ceylon.
the class IssuesTests_2000_2499 method testBug2024.
@Test
public void testBug2024() {
compile("bug20xx/bug2024a/module.ceylon", "bug20xx/bug2024a/package.ceylon", "bug20xx/bug2024a/Instant.ceylon");
compile("bug20xx/bug2024b/module.ceylon", "bug20xx/bug2024b/Bug2024.ceylon", "bug20xx/bug2024b/Bug2024.java");
compile("bug20xx/bug2024b/module.ceylon", "bug20xx/bug2024b/Bug2024.ceylon", "bug20xx/bug2024b/Bug2024B.java");
// special case: a single package module
List<String> options = new LinkedList<String>();
options.add("-src");
options.add(getPackagePath() + "/bug20xx");
options.addAll(defaultOptions);
CeyloncTaskImpl task = getCompilerTask(options, null, Arrays.asList("bug2024c"));
Boolean ret = task.call();
assertTrue(ret);
}
use of com.redhat.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon-compiler by ceylon.
the class MiscTests method debugIncrementalCompilationBug.
/**
* This test is for when we need to debug an incremental compilation error from the IDE, to make
* sure it is indeed a bug and find which bug it is, do not enable it by default, it's only there
* for debugging purpose. Once the bug is found, add it where it belongs (not here).
*/
@Ignore
@Test
public void debugIncrementalCompilationBug() {
java.util.List<File> sourceFiles = new ArrayList<File>();
String sdkSourcePath = "../ceylon-sdk/source";
String testSourcePath = "../ceylon-sdk/test-source";
for (String s : new String[] { "../ceylon-sdk/source/ceylon/json/StringPrinter.ceylon", "../ceylon-sdk/test-source/test/ceylon/json/print.ceylon", "../ceylon-sdk/source/ceylon/json/Array.ceylon", "../ceylon-sdk/test-source/test/ceylon/json/use.ceylon", "../ceylon-sdk/source/ceylon/net/uri/Path.ceylon", "../ceylon-sdk/test-source/test/ceylon/net/run.ceylon", "../ceylon-sdk/source/ceylon/json/Printer.ceylon", "../ceylon-sdk/source/ceylon/json/Object.ceylon", "../ceylon-sdk/source/ceylon/net/uri/Query.ceylon", "../ceylon-sdk/test-source/test/ceylon/json/run.ceylon", "../ceylon-sdk/test-source/test/ceylon/net/connection.ceylon", "../ceylon-sdk/source/ceylon/json/parse.ceylon", "../ceylon-sdk/test-source/test/ceylon/json/parse.ceylon", "../ceylon-sdk/source/ceylon/net/uri/PathSegment.ceylon" }) {
sourceFiles.add(new File(s));
}
CeyloncTool compiler;
try {
compiler = new CeyloncTool();
} catch (VerifyError e) {
System.err.println("ERROR: Cannot run tests! Did you maybe forget to configure the -Xbootclasspath/p: parameter?");
throw e;
}
CeyloncFileManager fileManager = (CeyloncFileManager) compiler.getStandardFileManager(null, null, null);
Iterable<? extends JavaFileObject> compilationUnits1 = fileManager.getJavaFileObjectsFromFiles(sourceFiles);
String compilerSourcePath = sdkSourcePath + File.pathSeparator + testSourcePath;
CeyloncTaskImpl task = (CeyloncTaskImpl) compiler.getTask(null, fileManager, null, Arrays.asList("-sourcepath", compilerSourcePath, "-d", "../ceylon-sdk/modules"), null, compilationUnits1);
Boolean result = task.call();
Assert.assertEquals("Compilation failed", Boolean.TRUE, result);
}
Aggregations