Examples of ExitState


Examples of com.redhat.ceylon.compiler.java.launcher.Main.ExitState

                break;
            }
        }
        // now compile it all the way
        Throwable ex = null;
        ExitState exitState = task.call2();
        switch (exitState.ceylonState) {
        case OK:
            if (expectedToFail) {
                Assert.fail("Compilation successful (it should have failed!)");
            }
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.launcher.Main.ExitState

        }
    }
   
    protected void compileIgnoringErrors(ExpectedError expectedErrors, String... ceylon) {
        ErrorCollector c = new ErrorCollector();
        ExitState exitState = getCompilerTask(c, ceylon).call2();
        assert(exitState.javacExitCode == Main.EXIT_ERROR);
        assert(exitState.ceylonState == CeylonState.ERROR);
        TreeSet<CompilerError> actualErrors = c.get(Diagnostic.Kind.ERROR);
        compareErrors(actualErrors,
                expectedErrors
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.launcher.Main.ExitState

        }
        Listener listener = new Listener();
        task.setTaskListener(listener);

        // now compile it all the way
        ExitState exitState = task.call2();
        Assert.assertEquals("Compilation failed", exitState.ceylonState, CeylonState.OK);

        // now look at what we expected
        String expectedSrc = normalizeLineEndings(readFile(new File(getPackagePath(), name+".src"))).trim();
        String compiledSrc = listener.compilerSrc.trim();
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.launcher.Main.ExitState

        }
        Listener listener = new Listener();
        task.setTaskListener(listener);

        // now compile it all the way
        ExitState exitState = task.call2();
        Assert.assertEquals("Compilation failed", exitState.ceylonState == CeylonState.OK);

        // now look at what we expected
        String expectedSrc = normalizeLineEndings(readFile(new File(getPackagePath(), name+".src"))).trim();
        String compiledSrc = listener.compilerSrc.trim();
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.launcher.Main.ExitState

        assertCompilesOk(c, getCompilerTask(c, ceylon).call2());
    }
   
    protected void compilesWithoutWarnings(String... ceylon) {
        ErrorCollector dl = new ErrorCollector();
        ExitState exitState = getCompilerTask(defaultOptions, dl, ceylon).call2();
        Assert.assertEquals(exitState.ceylonState, CeylonState.OK);
        Assert.assertEquals("The code compiled with javac warnings",
                0, dl.get(Diagnostic.Kind.WARNING).size() + dl.get(Diagnostic.Kind.MANDATORY_WARNING).size());
    }
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.launcher.Main.ExitState

        ErrorCollector collector = new ErrorCollector();
       
        CeyloncTaskImpl task = getCompilerTask(defaultOptions, collector, "bug17xx/Bug1773.ceylon");

        // now compile it all the way
        ExitState exitState = task.call2();
        Assert.assertEquals(ExitState.CeylonState.ERROR, exitState.ceylonState);
       
        // make sure we only got one, do not trust actualErrors.size() for that since it's a Set so
        // two methods with same contents would count as one.
        Assert.assertEquals(1, exitState.errorCount);
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.launcher.Main.ExitState

   
    @Test
    public void testBug1830() {
        ErrorCollector collector = new ErrorCollector();
        CeyloncTaskImpl task = getCompilerTask(defaultOptions, collector, "bug18xx/Bug1830.ceylon");
        ExitState call2 = task.call2();
        Assert.assertEquals(CeylonState.ERROR, call2.ceylonState);
        Assert.assertEquals(Main.EXIT_ERROR, call2.javacExitCode);
    }
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.launcher.Main.ExitState

   
    @Test
    public void testBug1836() {
        ErrorCollector collector = new ErrorCollector();
        CeyloncTaskImpl task = getCompilerTask(defaultOptions, collector, "bug18xx/Bug1836.ceylon");
        ExitState call2 = task.call2();
        Assert.assertEquals(CeylonState.ERROR, call2.ceylonState);
        Assert.assertEquals(Main.EXIT_ERROR, call2.javacExitCode);
    }
View Full Code Here

Examples of com.redhat.ceylon.compiler.java.launcher.Main.ExitState

        Iterable<? extends JavaFileObject> compilationUnits = fileManager.getJavaFileObjectsFromFiles(options.getFiles());

        CeyloncTaskImpl compilerTask = compiler.getTask(null, fileManager, diagnosticListener,
                                                        translateOptions(options), options.getModules(), compilationUnits);
        compilerTask.setTaskListener(diagnosticListener);
        ExitState state = compilerTask.call2();
        // print any helpful info if required
        if(options.isVerbose() && state.abortingException != null)
            state.abortingException.printStackTrace();
        return state.ceylonState == CeylonState.OK;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.