Class AutoCGTests

    • Field Detail

      • _cgDirectory

        protected static java.io.File _cgDirectory
        The directory where the code is generated, usually $HOME/cg.
      • _generateCodeMethod

        protected static java.lang.reflect.Method _generateCodeMethod
        The GenericCodeGenerator.generateCode(String[]) method.
    • Constructor Detail

      • AutoCGTests

        public AutoCGTests()
    • Method Detail

      • setUp

        public void setUp()
                   throws java.lang.Throwable
        Find the ptolemy.cg.kernel.generic.GenericCodeGenerator class and its generateCode static method that takes an array of strings.
        Throws:
        java.lang.Throwable - If the class or constructor cannot be found.
      • runModel

        public void runModel​(java.lang.String fullPath,
                             java.lang.String language,
                             boolean generateInSubdirectory,
                             boolean inline,
                             int maximumLinesPerBlock,
                             boolean variablesAsArrays,
                             java.lang.String generatorPackageList)
                      throws java.lang.Throwable
        Generate, compile and run code for a model. The
        Parameters:
        fullPath - The full path to the model file to be executed. If the fullPath ends with the value of the ModelTests.THERE_ARE_NO_AUTO_TESTS, then the method returns immediately.
        language - Either "c" or "java".
        generateInSubdirectory - If true, then generate the code in in a subdirectory of ~/cg/.
        inline - If true, then generate inline code.
        maximumLinesPerBlock - The maximum number of line of code generated per block
        variablesAsArrays - If true, then try to save space by putting variables into arrays.
        generatorPackageList - A semicolon or * separated list of Java packages to be searched for adapters. For example, generic.program.procedural.c.arduino means use the arduino target.
        Throws:
        java.lang.Throwable - If thrown while generating, compiling or executing the compiled code.