next up previous contents
Next: Best Practices for Test Up: Completing a Thorn Previous: Contribution to Thorn Guide   Contents


Adding a Test Suite

To add a test suite to your thorn, devise a series of parameter files which use as many aspects of your thorn as possible. Make sure that the parameter files produce ASCII output to files, and that these files are in the directory ./<parameter file base name>.

Run Cactus on each of the parameter files, and move the parameter files, and the output directories they produced, to the test directory in your thorn.

Document carefully any situations or architectures in which your test suite does not give the correct answers.

You can also specify options for running your testsuite by adding an optional configuration file called test.ccl in the test directory. These are simple text files and may contain comments introduced by the hash `#' character, which indicates that the rest of the line is a comment. If the last non-blank character of a line in a config file is a backslash `11#11', the following line is treated as a continuation of the current line. Options include test specific absolute and relative tolerances, thorn specific absolute and relative tolerances, the number of procesors required to run, and file extensions. The configuration file has the form:

ABSTOL  <thorn_absolute_tolerance>
RELTOL  <thorn_relative_tolerance>
NPROCS  <thorn_nprocs>
EXTENSIONS  <extension_1 extension_2 extension_3>

TEST <test_example>
{
  ABSTOL <absolute_tol>
  RELTOL <relative_tol>
  NPROCS <nprocs>
}

which states that when comparing files of test test_example, both absolute_tol and relative_tol should be used as the absolute and relative tolerances. For all other tests in the thorn, the default value of absolute and relative tolerances are set to thorn_absolute_tolerance and thorn_relative_tolerance. The NPROCS option specifies the number of processors required to run a given testsuite test_example or all testsuites of a thorn successfully. If no NPROCS option is present, the testsuite(s) is (are) assumed to run with any number of processors. The EXTENSIONS option adds extension_1, extension_2 and extension_3 to the list of file extensions that are compared. This list is global over all tests in a configuration.

Test specific tolerances have precedence over all tolerances, next come thorn wide tolerances, and then cactus default tolerances. Absolute and relative tolerances are independent: you can choose to use test specific absolute tolerance and thorn specific relative tolerance when running a test. For example,

TEST test_rad
{
  ABSTOL 1e-5
}

ABSTOL  1e-8
RELTOL  1e-12

would use an absolute tolerance of 37#37 and a relative tolerance of 38#38 when running test_rad and an absolute tolerance of 39#39 and a relative tolerance of 38#38 when running all other tests.

For details on running the test suites, see Section A2.4.



Subsections
next up previous contents
Next: Best Practices for Test Up: Completing a Thorn Previous: Contribution to Thorn Guide   Contents