use of com.redhat.ceylon.compiler.CeylonCompileTool in project ceylon-compiler by ceylon.
the class CompilerToolTests method testCompileMultipleAutodetect.
@Test
public void testCompileMultipleAutodetect() throws Exception {
File carFile1 = getModuleArchive("com.first", "1");
carFile1.delete();
File carFile2 = getModuleArchive("com.second", "1");
carFile2.delete();
File carFile3 = getModuleArchive("single", "1");
carFile3.delete();
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--src=test/src/com/redhat/ceylon/tools/test/bugCC59"));
tool.run();
assertTrue(carFile1.exists() && carFile2.exists() && carFile3.exists());
}
use of com.redhat.ceylon.compiler.CeylonCompileTool in project ceylon-compiler by ceylon.
the class CompilerToolTests method testBug1183.
@Test
public void testBug1183() throws Exception {
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--src=test/src", "com.redhat.ceylon.tools.test.bug1183"));
try {
tool.run();
Assert.fail("Tool should have thrown an exception");
} catch (CompilerErrorException e) {
// We expect this, not a FatalToolError
}
}
use of com.redhat.ceylon.compiler.CeylonCompileTool in project ceylon-compiler by ceylon.
the class CompilerToolTests method testCompileNoSuchModule.
@Test
public void testCompileNoSuchModule() throws Exception {
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
try {
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--src=test/src", "com.redhat.ceylon.tools.test.nosuchmodule"));
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("Module com.redhat.ceylon.tools.test.nosuchmodule not found in source directories: test" + File.separator + "src", e.getMessage());
}
}
use of com.redhat.ceylon.compiler.CeylonCompileTool in project ceylon-compiler by ceylon.
the class CompilerToolTests method testCompileWithOomeException.
@Test
public void testCompileWithOomeException() throws Exception {
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--src=test/src", "com.redhat.ceylon.tools.test.oome"));
try {
tool.run();
Assert.fail("Tool should have thrown an exception");
} catch (SystemErrorException x) {
Assert.assertEquals("java.lang.OutOfMemoryError", x.getMessage());
}
}
use of com.redhat.ceylon.compiler.CeylonCompileTool in project ceylon-compiler by ceylon.
the class CompilerToolTests method testCompileWithAnalysisErrors.
@Test
public void testCompileWithAnalysisErrors() throws Exception {
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--src=test/src", "com.redhat.ceylon.tools.test.analysis"));
try {
tool.run();
Assert.fail("Tool should have thrown an exception");
} catch (CompilerErrorException x) {
Assert.assertEquals("There were 3 errors", x.getMessage());
} catch (Throwable t) {
t.printStackTrace();
Assert.fail("Unexpected exception");
}
}
Aggregations