Package com.redhat.ceylon.compiler.java.test

Examples of com.redhat.ceylon.compiler.java.test.ErrorCollector


    }

    @Test
    public void testBug1347() {
        Assume.assumeTrue("Runs on JDK8", JDKUtils.jdk == JDKUtils.JDK.JDK8);
        ErrorCollector c = new ErrorCollector();
        assertCompilesOk(c, getCompilerTask(Arrays.asList("-rep", "test/java8/modules"), c, "bug13xx/bug1347/bug1347.ceylon").call2());
    }
View Full Code Here


            compiler = new CeyloncTool();
        } catch (VerifyError e) {
            System.err.println("ERROR: Cannot run tests! Did you maybe forget to configure the -Xbootclasspath/p: parameter?");
            throw e;
        }
        ErrorCollector errorCollector = new ErrorCollector();
        CeyloncFileManager fileManager = (CeyloncFileManager)compiler.getStandardFileManager(null, null, null);
        CeyloncTaskImpl task = (CeyloncTaskImpl) compiler.getTask(null, fileManager, errorCollector,
                Arrays.asList("-sourcepath", sourceDir, "-d", "build/classes-sdk",
                        "-suppress-warnings", "ceylonNamespace",
                        "-cp", getClassPathAsPath()),
                        moduleNames, null);
        Boolean result = task.call();
        Assert.assertEquals("Compilation of SDK itself failed: " + errorCollector.getAssertionFailureMessage(), Boolean.TRUE, result);
    }
View Full Code Here

            compiler = new CeyloncTool();
        } catch (VerifyError e) {
            System.err.println("ERROR: Cannot run tests! Did you maybe forget to configure the -Xbootclasspath/p: parameter?");
            throw e;
        }
        ErrorCollector errorCollector = new ErrorCollector();
        CeyloncFileManager fileManager = (CeyloncFileManager)compiler.getStandardFileManager(null, null, null);
        CeyloncTaskImpl task = (CeyloncTaskImpl) compiler.getTask(null, fileManager, errorCollector,
                Arrays.asList("-sourcepath", sourceDir, "-rep", depsDir, "-d", "build/classes-sdk", "-cp", getClassPathAsPath()),
                moduleNames, null);
       
        Boolean result = task.call();
        Assert.assertEquals("Compilation of SDK tests failed:" + errorCollector.getAssertionFailureMessage(), Boolean.TRUE, result);
    }
View Full Code Here

        }
        Assert.assertEquals("Sequences differ", expect, sb);
    }

    private ErrorCollector compileIgnoringCeylonErrors(String... ceylon) {
        ErrorCollector c = new ErrorCollector();
        getCompilerTask(defaultOptions, c, ceylon).call2();
        Assert.assertTrue("Expected only ceylon errors: " + c.getAssertionFailureMessage(), 0 == c.getNumBackendErrors());
        return c;
    }
View Full Code Here

        List<String> options = new LinkedList<String>();
        options.add("-src");
        options.add(srcPath);
        options.addAll(defaultOptions);
        options.add("-continue");
        ErrorCollector c = new ErrorCollector();
        CeyloncTaskImpl task = getCompilerTask(options,
                c,
                Arrays.asList("okmodule"),
                subPath + "/dupdeclerr1.ceylon",
                subPath + "/dupdeclerr2.ceylon",
                subPath + "/someok.ceylon");
        Boolean ret = task.call();
        assertFalse(ret);

        TreeSet<CompilerError> actualErrors = c.get(Diagnostic.Kind.ERROR);
        compareErrors(actualErrors,
//                new CompilerError(21, "cannot find module artifact notfound-1(.car|.jar)\n  \t- dependency tree: okmodule/1.0.0 -> notfound/1"),
                new CompilerError(20, "duplicate declaration name: 'run'"));
       
        File carFile = getModuleArchive("default", null);
View Full Code Here

        List<String> options = new LinkedList<String>();
        options.add("-src");
        options.add(srcPath);
        options.addAll(defaultOptions);
        options.add("-continue");
        ErrorCollector c = new ErrorCollector();
        CeyloncTaskImpl task = getCompilerTask(options,
                c,
                Arrays.asList("okmodule"),
                subPath + "/someok.ceylon");
        Boolean ret = task.call();
        assertFalse(ret);

        TreeSet<CompilerError> actualErrors = c.get(Diagnostic.Kind.ERROR);
        compareErrors(actualErrors,
                new CompilerError(21, "cannot find module artifact notfound-1(.car|.jar)\n  \t- dependency tree: okmodule/1.0.0 -> notfound/1"));
       
        File carFile = getModuleArchive("default", null);
        assertTrue(carFile.exists());
View Full Code Here

        List<String> options = new LinkedList<String>();
        options.add("-src");
        options.add(srcPath);
        options.addAll(defaultOptions);
        options.add("-continue");
        ErrorCollector c = new ErrorCollector();
        CeyloncTaskImpl task = getCompilerTask(options,
                c,
                Arrays.asList("okmodule"),
                subPath + "/someok.ceylon");
        Boolean ret = task.call();
        assertFalse(ret);

        TreeSet<CompilerError> actualErrors = c.get(Diagnostic.Kind.ERROR);
        compareErrors(actualErrors,
                new CompilerError(-1, "incorrect syntax: no viable alternative at token end of file"),
                new CompilerError(20, "incorrect syntax: mismatched token 'ERROR' expecting initial-lowercase identifier"),
                new CompilerError(20, "incorrect syntax: no viable alternative at token '\"1.0.0\"'"),
                new CompilerError(20, "incorrect syntax: no viable alternative at token 'okmodule'")
View Full Code Here

        List<String> options = new LinkedList<String>();
        options.add("-src");
        options.add(srcPath);
        options.addAll(defaultOptions);
        options.add("-continue");
        ErrorCollector c = new ErrorCollector();
        CeyloncTaskImpl task = getCompilerTask(options,
                c,
                subPath + "/dupdecl.ceylon",
                subPath + "/moduletest1/module.ceylon",
                subPath + "/moduletest1/package.ceylon",
                subPath + "/moduletest1/helloworld.ceylon",
                subPath + "/hello/hello.ceylon",
                subPath + "/hello/module.ceylon",
                subPath + "/hello/package.ceylon",
                subPath + "/testtest/module.ceylon",
                subPath + "/testtest/test.ceylon",
                subPath + "/sub/mod/module.ceylon",
                subPath + "/sub/mod/run.ceylon",
                subPath + "/sub/mod/package.ceylon",
                subPath + "/unknownmodule/module.ceylon",
                subPath + "/unknownmodule/run.ceylon",
                subPath + "/unknownmodule/package.ceylon",
                subPath + "/interop/module.ceylon",
                subPath + "/interop/interop.ceylon",
                subPath + "/jsonly/jsonly.ceylon",
                subPath + "/jsonly/module.ceylon",
                subPath + "/jsonly/package.ceylon",
                subPath + "/modulep/module.ceylon",
                subPath + "/modulep/main.ceylon",
                subPath + "/browser/dom/main.ceylon",
                subPath + "/browser/dom/package.ceylon",
                subPath + "/browser/module.ceylon",
                subPath + "/browser/main.ceylon",
                subPath + "/browser/package.ceylon",
                subPath + "/test/InheritanceAndBoxingTest.ceylon",
                subPath + "/test/ExceptionTest.ceylon",
                subPath + "/test/Foo.ceylon",
                subPath + "/test/GameOfLife.ceylon",
                subPath + "/test/Bar.ceylon",
                subPath + "/test/encoding.ceylon",
                subPath + "/test/helloworld.ceylon",
                subPath + "/swing/module.ceylon",
                subPath + "/swing/run.ceylon",
                subPath + "/swing/package.ceylon",
                subPath + "/interoprev/module.ceylon",
                subPath + "/interoprev/run.ceylon",
                subPath + "/interoprev/package.ceylon",
                subPath + "/java/hello.ceylon",
                subPath + "/java/module.ceylon",
                subPath + "/java/package.ceylon",
                subPath + "/helloworld.ceylon",
                subPath + "/wrongversion/module.ceylon",
                subPath + "/wrongversion/run.ceylon",
                subPath + "/wrongversion/package.ceylon",
                subPath + "/importhello/module.ceylon",
                subPath + "/importhello/helloworld.ceylon",
                subPath + "/usingimport.ceylon",
                // These depend on the error recovery we plan for 1.1
//                subPath + "/javaa/bugJvm1290.ceylon",
//                subPath + "/javaa/module.ceylon",
//                subPath + "/javaa/run.ceylon"
                subPath + "/gavinprob/module.ceylon",
                subPath + "/gavinprob/main.ceylon",
                subPath + "/web_ide_script/module.ceylon",
                subPath + "/web_ide_script/hello_world.ceylon",
                subPath + "/timetest/module.ceylon",
                subPath + "/timetest/test.ceylon"
                );
        Boolean ret = task.call();
        assertFalse(ret);

        TreeSet<CompilerError> actualErrors = c.get(Diagnostic.Kind.ERROR);
        compareErrors(actualErrors,
                new CompilerError(1, "package not found in imported modules: 'java.lang' (define a module and add module import to its module descriptor)"),
                new CompilerError(1, "source code imports two different versions of module 'ceylon.file': version \"0.5\" and version \"1.1.0\""),
                new CompilerError(2, "cannot find module artifact fooxhilio.bastardo-77.9(.car|.jar)\n"
                +"  \t- dependency tree: unknownmodule/1.0.0 -> fooxhilio.bastardo/77.9"),
View Full Code Here

        List<String> options = new LinkedList<String>();
        options.add("-src");
        options.add(srcPath);
        options.addAll(defaultOptions);
        options.add("-continue");
        ErrorCollector c = new ErrorCollector();
        CeyloncTaskImpl task = getCompilerTask(options,
                c,
                subPath + "/someok.ceylon");
        Boolean ret = task.call();
        assertFalse(ret);

        TreeSet<CompilerError> actualErrors = c.get(Diagnostic.Kind.ERROR);
        compareErrors(actualErrors,
                new CompilerError(23, "type does not exist: 'ERROR'")
        );
       
        File carFile = getModuleArchive("default", null);
View Full Code Here

//        System.err.println("Let's go");
        long totals = 0;
        int runs = 1;
        for(int i=0;i<runs;i++){
            long start = System.nanoTime();
            ErrorCollector c = new ErrorCollector();
            assertCompilesOk(c, getCompilerTask(Arrays.asList(/*"-verbose:benchmark", */"-out", destDir), c, "bug16xx/bug1631/run.ceylon").call2());
//            benchmarkParse("bug16xx/bug1631/run.ceylon");
            long end = System.nanoTime();
            long total = end - start;
            System.err.println("Took "+(total/1_000_000)+"ms");
View Full Code Here

TOP

Related Classes of com.redhat.ceylon.compiler.java.test.ErrorCollector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.