Search in sources :

Example 1 with DiagnosticListener

use of org.eclipse.ceylon.compiler.js.DiagnosticListener 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]);
}
Also used : CeylonCompileJsTool(org.eclipse.ceylon.compiler.js.CeylonCompileJsTool) DiagnosticListener(org.eclipse.ceylon.compiler.js.DiagnosticListener) File(java.io.File) Test(org.junit.Test)

Aggregations

File (java.io.File)1 CeylonCompileJsTool (org.eclipse.ceylon.compiler.js.CeylonCompileJsTool)1 DiagnosticListener (org.eclipse.ceylon.compiler.js.DiagnosticListener)1 Test (org.junit.Test)1