use of org.eclipse.ceylon.compiler.js.CeylonCompileJsTool in project ceylon by eclipse.
the class CompileJsToolTest method testDefaultModuleWithAltRoot.
@Test
public void testDefaultModuleWithAltRoot() throws Exception {
FileUtil.delete(new File("build/test-modules"));
ToolModel<CeylonCompileJsTool> tool = pluginLoader.loadToolModel("compile-js");
Assert.assertNotNull(tool);
CeylonCompileJsTool jsc = pluginFactory.bindArguments(tool, getMainTool(), args("--source=src/test/resources/doc", "--resource=src/test/resources/res_test", "--resource-root=ALTROOT", "default"));
jsc.run();
checkCompilerResult("build/test-modules/default", "default");
checkResources("build/test-modules/default", "default", "test.txt", "another_test.txt", "subdir/third.txt", "ALTROOT/altroot.txt", "ROOT/inroot.txt");
checkExcludedResources("build/test-modules/default", "default", "m1res.txt", "m1/m1res.txt", "m1/ROOT/m1root.txt", "ROOT/m1root.txt", "m1/ALTROOT/altrootm1.txt");
}
use of org.eclipse.ceylon.compiler.js.CeylonCompileJsTool in project ceylon by eclipse.
the class CompileJsToolTest method testModuleSourceInvalidResource.
@Test(expected = ToolUsageError.class)
public void testModuleSourceInvalidResource() throws Exception {
FileUtil.delete(new File("build/test-modules"));
ToolModel<CeylonCompileJsTool> tool = pluginLoader.loadToolModel("compile-js");
Assert.assertNotNull(tool);
CeylonCompileJsTool jsc = pluginFactory.bindArguments(tool, getMainTool(), args("--source=src/test/resources/loader/pass1", "--resource=src/test/resources/res_test", "src/test/resources/loader/pass1/m1/test.ceylon", "src/test/resources/loader/pass1/m1/module.ceylon", "src/test/resources/loader/pass1/m1/package.ceylon", "src/test/resources/res_test/m1/invalid.txt"));
jsc.run();
}
use of org.eclipse.ceylon.compiler.js.CeylonCompileJsTool in project ceylon by eclipse.
the class CompileJsToolTest method testModuleFileNoResources.
@Test
public void testModuleFileNoResources() throws Exception {
FileUtil.delete(new File("build/test-modules"));
ToolModel<CeylonCompileJsTool> tool = pluginLoader.loadToolModel("compile-js");
Assert.assertNotNull(tool);
CeylonCompileJsTool jsc = pluginFactory.bindArguments(tool, getMainTool(), args("--source=src/test/resources/loader/pass1", "--resource=src/test/resources/res_test", "src/test/resources/loader/pass1/m1/test.ceylon", "src/test/resources/loader/pass1/m1/module.ceylon", "src/test/resources/loader/pass1/m1/package.ceylon"));
jsc.run();
checkCompilerResult("build/test-modules/m1/0.1", "m1-0.1");
checkNoResources("build/test-modules/default", "default");
}
use of org.eclipse.ceylon.compiler.js.CeylonCompileJsTool in project ceylon by eclipse.
the class CompileJsToolTest method testBug641.
@Test
public void testBug641() throws Exception {
ToolModel<CeylonCompileJsTool> tool = pluginLoader.loadToolModel("compile-js");
Assert.assertNotNull(tool);
CeylonCompileJsTool jsc = pluginFactory.bindArguments(tool, getMainTool(), args("--source=src/test/resources/bugs", "bug641"));
final int[] warnings = { 0 };
jsc.setDiagnosticListener(new DiagnosticListener() {
@Override
public void warning(File file, long line, long column, String message) {
warnings[0]++;
}
@Override
public void moduleCompiled(String module, String version) {
}
@Override
public void error(File file, long line, long column, String message) {
}
});
jsc.run();
Assert.assertEquals(0, warnings[0]);
}
use of org.eclipse.ceylon.compiler.js.CeylonCompileJsTool in project ceylon by eclipse.
the class CompileJsToolTest method testModuleTwiceAgain.
@Test
public void testModuleTwiceAgain() throws Exception {
FileUtil.delete(new File("build/test-modules"));
ToolModel<CeylonCompileJsTool> tool = pluginLoader.loadToolModel("compile-js");
Assert.assertNotNull(tool);
CeylonCompileJsTool jsc = pluginFactory.bindArguments(tool, getMainTool(), args("--source=src/test/resources/loader/pass1", "--resource=src/test/resources/res_test", "m1"));
jsc.run();
jsc = pluginFactory.bindArguments(tool, getMainTool(), args("--source=src/test/resources/loader/pass1", "--resource=src/test/resources/res_test", "src/test/resources/loader/pass1/m1/test.ceylon", "src/test/resources/loader/pass1/m1/module.ceylon", "src/test/resources/loader/pass1/m1/package.ceylon", "src/test/resources/res_test/m1/m1res.txt"));
jsc.run();
checkCompilerResult("build/test-modules/m1/0.1", "m1-0.1");
checkResources("build/test-modules/m1/0.1", "m1-0.1", "m1root.txt", "m1/m1res.txt", "m1/ALTROOT/altrootm1.txt");
checkExcludedResources("build/test-modules/m1/0.1", "m1-0.1", "test.txt", "another_test.txt", "subdir/third.txt", "ROOT/inroot.txt", "ALTROOT/altroot.txt");
}
Aggregations