Class TclTests


  • public class TclTests
    extends java.lang.Object
    Run the Tcl tests under JUnit.

    This test must be run from the directory that contains the auto/ directory, for example:

     (cd ~/ptII/ptolemy/actor/lib/io/test; java -classpath ${PTII}:${PTII}/lib/ptjacl.jar:${PTII}/lib/junit-4.8.2.jar:${PTII}/lib/JUnitParams-0.3.0.jar org.junit.runner.JUnitCore ptolemy.util.test.junit.TclTests)
     

    This test uses JUnitParams from http://code.google.com/p/junitparams/, which is released under Apache License 2.0.

    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Christopher Brooks
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Red (cxh)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.String THERE_ARE_NO_TCL_TESTS
      A special string that is passed when there are no tcl tests.
    • Constructor Summary

      Constructors 
      Constructor Description
      TclTests()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected static void _incrementTclFileCount()
      Increment the count of the number of tcl files visited.
      protected static void _setFailedTestCount​(java.lang.Object count)
      Set the cached value of the count of the number of failed tests.
      static void doneTests()
      Call the Tcl doneTests command to print out the number of errors.
      java.lang.Object[] parametersForRunTclFile()
      Return a two dimensional array of arrays of strings that name the .tcl files to be executed.
      void RunTclFile​(java.lang.String tclFile)
      Run a tclFile.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • THERE_ARE_NO_TCL_TESTS

        protected static final java.lang.String THERE_ARE_NO_TCL_TESTS
        A special string that is passed when there are no tcl tests. This is necessary to avoid an exception in the JUnitParameters.
        See Also:
        Constant Field Values
    • Constructor Detail

      • TclTests

        public TclTests()
    • Method Detail

      • doneTests

        public static void doneTests()
                              throws java.lang.Throwable
        Call the Tcl doneTests command to print out the number of errors.
        Throws:
        java.lang.Throwable - If the class, constructor or method cannot be found. or if the Interp cannot be instantiated.
      • parametersForRunTclFile

        public java.lang.Object[] parametersForRunTclFile()
                                                   throws java.io.IOException
        Return a two dimensional array of arrays of strings that name the .tcl files to be executed. If there are no .tcl files, return a list with one element that has the value of the THERE_ARE_NO_TCL_TESTS field.
        Returns:
        The List of tcl tests.
        Throws:
        java.io.IOException - If there is a problem accessing the auto/ directory.
      • RunTclFile

        public void RunTclFile​(java.lang.String tclFile)
                        throws java.lang.Throwable
        Run a tclFile.

        Timeout after 480000 ms. The ptolemy/cg/kernel/generic/program/procedural/java/test/AutoAdapter.tcl test requires more than 240 seconds.

        Parameters:
        tclFile - The full path to the .tcl file to be executed. If tclFile ends with the value of the THERE_ARE_NO_TCL_TESTS, then the method returns immediately.
        Throws:
        java.lang.Throwable - If thrown while executing the tclFile.
      • _incrementTclFileCount

        protected static void _incrementTclFileCount()
        Increment the count of the number of tcl files visited. Keep track of the number of Tcl files evaluated If 1 or more files were evaluated, then we call doneTests.
      • _setFailedTestCount

        protected static void _setFailedTestCount​(java.lang.Object count)
        Set the cached value of the count of the number of failed tests.
        Parameters:
        count - The object representing the number of failed tests.