Examples of MessageLogger


Examples of org.openquark.cal.compiler.MessageLogger

    }


    public void testInvalidCoercion_lecc ()  {
        if (leccCALServices != null) {
            CompilerMessageLogger logger = new MessageLogger();
            AdjunctSource as = new AdjunctSource.FromText("testRunTarget = jObjectToInteger (unsafeCoerce (1 :: Int));");
            EntryPoint entryPoint =
                leccCALServices.getCompiler().getEntryPoint(
                    as,
                    EntryPointSpec.make(QualifiedName.make(CALPlatformTestModuleNames.RuntimeRegression, "testRunTarget")),
View Full Code Here

Examples of org.openquark.cal.compiler.MessageLogger

            help_testCAF_Cacheing(gCALServices);
        }
    }

    private void help_testCAF_Cacheing (BasicCALServices calServices) throws CALExecutorException {
        CompilerMessageLogger ml = new MessageLogger ();

        // Compile it, indicating that this is an adjunct
        EntryPoint targetEntryPoint =
            calServices.getWorkspaceManager().getCompiler().getEntryPoint(
                EntryPointSpec.make(QualifiedName.make(CALPlatformTestModuleNames.RuntimeRegression, "getCallCountCAF")),
View Full Code Here

Examples of org.openquark.cal.compiler.MessageLogger

       
        EntryPoint entryPoint = calServices.getCompiler().getEntryPoint(
            new AdjunctSource.FromText("private tempFunc = System.registerCleanable ((input (System.getProperty \"hook\")) :: Cleanable);"),
            EntryPointSpec.make(QualifiedName.make(CAL_System.MODULE_NAME, "tempFunc")),
            CAL_System.MODULE_NAME,
            new MessageLogger());
       
        CALExecutor executor = calServices.getWorkspaceManager().makeExecutor(executionContext);
       
        executor.exec(entryPoint, new Object[0]);
        calServices.getWorkspaceManager().resetCachedResults(executor.getContext());
View Full Code Here

Examples of org.openquark.cal.compiler.MessageLogger

    }
   
    private void help_testProgramEvaluatorEval_OutputPrimitiveArray(BasicCALServices calServices) throws CALExecutorException {
        String functionName = "tempFunc";
       
        CompilerMessageLogger logger = new MessageLogger();
       
        EntryPoint entryPoint = calServices.getCompiler().getEntryPoint(
            new AdjunctSource.FromSourceModel(SourceModel.FunctionDefn.Algebraic.make(
            functionName, Scope.PRIVATE, null,
            SourceModel.Expr.makeGemCall(CAL_Array.Functions.outputPrimitive,
View Full Code Here

Examples of org.openquark.cal.compiler.MessageLogger

    }
   
    private void help_testProgramEvaluatorEval_OutputNonPrimitiveArray(BasicCALServices calServices) throws CALExecutorException {
        String functionName = "tempFunc";
               
        CompilerMessageLogger logger = new MessageLogger();
        EntryPoint entryPoint = calServices.getCompiler().getEntryPoint(
            new AdjunctSource.FromSourceModel(
                SourceModel.FunctionDefn.Algebraic.make(
                    functionName, Scope.PRIVATE, null,
                    SourceModel.Expr.makeGemCall(CAL_Array.Functions.subscript,
View Full Code Here

Examples of org.openquark.cal.compiler.MessageLogger

        help_testUnknownImport(leccCALServices);
        help_testUnknownImport(gCALServices);
    }
   
    private void help_testUnknownImport(BasicCALServices calServices) {
        MessageLogger logger = new MessageLogger();
        SourceModelModuleSource moduleDefn = new SourceModelModuleSource(SourceModelUtilities.TextParsing.parseModuleDefnIntoSourceModel("module Foo; import Prelude; import UNKNOWN_Module;", logger));
       
        assertEquals(logger.getNErrors(), 0);
       
        calServices.addNewModule(moduleDefn, logger);
       
        if (logger.getNErrors() > 0) {
            List<CompilerMessage> messages = logger.getCompilerMessages();
            for (int i = 0, n = messages.size(); i < n; i++) {
                CompilerMessage message = messages.get(i);
                if (CompilerTestUtilities.isInternalCodingError(message.getMessageKind())) {
                     fail("Unexpected: " + message);
                }
View Full Code Here

Examples of org.openquark.cal.compiler.MessageLogger

                            //Make entry point specs - there will be numCompilationsPerThread unique
                            //entry point specs
                            EntryPointSpec spec =
                                EntryPointSpec.make(CAL_Prelude.Functions.add, new InputPolicy[] {
                                        InputPolicy.makeWithMarshaler(SourceModelUtilities.TextParsing.parseExprIntoSourceModel("add ("+j*2+"::Int) # Prelude.input ", new MessageLogger())),
                                        InputPolicy.DEFAULT_INPUT_POLICY},
                                        OutputPolicy.DEFAULT_OUTPUT_POLICY);

                            for(int k =0; k < numTimesToRun; k++) {
                                Integer addResult = (Integer) basicCalServices.runFunction(spec, new Integer[] {j, j/2});
View Full Code Here

Examples of org.openquark.cal.compiler.MessageLogger

       
        SourceModel.ModuleDefn moduleDefn = SourceModel.ModuleDefn.make(moduleName, new SourceModel.Import[] { SourceModel.Import.make(CAL_Prelude.MODULE_NAME) }, null);
        ModuleSourceDefinition moduleSourceDefn = new SourceModelModuleSource(moduleDefn);

        try {
            CompilerMessageLogger logger = new MessageLogger();
            Severity severity = workspaceManager.makeModule(moduleSourceDefn, logger);
           
            assertTrue(severity.compareTo(Severity.ERROR) < 0);

            //todo-jowong these assertions should be true, but are currently false because
View Full Code Here

Examples of org.openquark.cal.compiler.MessageLogger

        ModuleSourceDefinition[] moduleSourceDefns = { moduleSourceDefn1, moduleSourceDefn2 };
       
        ModuleSourceDefinitionGroup mdg = new ModuleSourceDefinitionGroup(moduleSourceDefns);

        try {
            CompilerMessageLogger logger = new MessageLogger();
            Severity severity = workspaceManager.makeModules(moduleNames, mdg, logger);
           
            assertTrue(severity.compareTo(Severity.ERROR) < 0);

            //todo-jowong these assertions should be true, but are currently false because
View Full Code Here

Examples of org.openquark.cal.compiler.MessageLogger

       
        ModuleSourceDefinition[] moduleSourceDefns = { moduleSourceDefn1, moduleSourceDefn2 };
       
        ModuleSourceDefinitionGroup mdg = new ModuleSourceDefinitionGroup(moduleSourceDefns);

        CompilerMessageLogger logger = new MessageLogger();
        Severity severity = workspaceManager.makeModules(moduleNames, mdg, logger);
       
        assertTrue(severity.compareTo(Severity.ERROR) < 0);
       
        Status status = new Status("Removal of test modules");
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.