use of com.redhat.ceylon.compiler.CeylonCompileTool in project ceylon-compiler by ceylon.
the class CompilerToolTests method testCompile.
@Test
public void testCompile() 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.ceylon"));
tool.run();
}
use of com.redhat.ceylon.compiler.CeylonCompileTool in project ceylon-compiler by ceylon.
the class CompilerToolTests method testCompileVerbose.
@Test
public void testCompileVerbose() throws Exception {
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--verbose", "--src=test/src", "com.redhat.ceylon.tools.test.ceylon"));
tool.run();
}
use of com.redhat.ceylon.compiler.CeylonCompileTool in project ceylon-compiler by ceylon.
the class CompilerToolTests method testCompileNoSuchEncoding.
@Test
public void testCompileNoSuchEncoding() throws Exception {
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
try {
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--src=test/src", "--encoding=foo", "com.redhat.ceylon.tools.test.ceylon"));
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("Unsupported encoding: foo", e.getMessage());
}
}
use of com.redhat.ceylon.compiler.CeylonCompileTool in project ceylon-compiler by ceylon.
the class CompilerToolTests method testBug1623.
@Test
public void testBug1623() 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/empty"));
Assert.fail("Tool should have thrown an exception");
} catch (ToolUsageError e) {
Assert.assertEquals("No modules or source files to compile", e.getMessage());
}
}
use of com.redhat.ceylon.compiler.CeylonCompileTool in project ceylon-compiler by ceylon.
the class CompilerToolTests method testCompileWithStackOverflowError.
@Test
public void testCompileWithStackOverflowError() 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.stackoverflow"));
try {
tool.run();
Assert.fail("Tool should have thrown an exception");
} catch (SystemErrorException x) {
Assert.assertEquals("java.lang.StackOverflowError", x.getMessage());
}
}
Aggregations