use of org.eclipse.ceylon.compiler.CeylonCompileTool in project ceylon by eclipse.
the class CompilerToolTests method testDefaultModuleNoFiles.
@Test
public void testDefaultModuleNoFiles() throws Exception {
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
try {
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("--src=test/src/org/eclipse/ceylon/tools/test/empty", "default"));
tool.run();
Assert.fail("Tool should have thrown an exception");
} catch (ToolUsageError e) {
Assert.assertEquals("Module default does not contain any sources or resources", e.getMessage());
}
}
use of org.eclipse.ceylon.compiler.CeylonCompileTool in project ceylon by eclipse.
the class CompilerToolTests method testTarget.
@Test
public void testTarget() throws Exception {
Assume.assumeTrue("Runs on JDK8", JDKUtils.jdk == JDKUtils.JDK.JDK8 || JDKUtils.jdk == JDKUtils.JDK.JDK9);
ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
Assert.assertNotNull(model);
CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("--src=test/src", "--target=8", "org.eclipse.ceylon.tools.test.java8"));
tool.run();
}
use of org.eclipse.ceylon.compiler.CeylonCompileTool in project ceylon by eclipse.
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(), toolOptions("--src=test/src/org/eclipse/ceylon/tools/test/empty"));
Assert.fail("Tool should have thrown an exception");
} catch (NonFatalToolMessage e) {
Assert.assertEquals("No modules or source files to compile", e.getMessage());
}
}
use of org.eclipse.ceylon.compiler.CeylonCompileTool in project ceylon by eclipse.
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(), toolOptions("--verbose", "--src=test/src", "org.eclipse.ceylon.tools.test.ceylon"));
tool.run();
}
use of org.eclipse.ceylon.compiler.CeylonCompileTool in project ceylon by eclipse.
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(), toolOptions("--src=test/src", "--encoding=foo", "org.eclipse.ceylon.tools.test.ceylon"));
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("Unsupported encoding: foo", e.getMessage());
}
}
Aggregations