testcode.py - a command-line interface to testcode.
testcode.py [options] [action1 [action2...]]
Run a set of actions on a set of tests.
testcode.py provides a command-line interface to testcode, a simple framework for comparing output from (principally numeric) programs to previous output to reveal regression errors or miscompilation.
‘’run’’ is th default action.
- compare set of test outputs from a previous testcode run against the benchmark outputs.
- diff set of test outputs from a previous testcode run against the benchmark outputs.
- create a new set of benchmarks and update the userconfig file with the new benchmark id. Also runs the ‘run’ action unless the ‘compare’ action or ‘recheck’ action is also given.
- compare set of test outputs from a previous testcode run against benchmark outputs and rerun any failed tests.
- run a set of tests and compare against the benchmark outputs.
- Remove files from previous testcode runs from the test directories.
|-h, --help||show this help message and exit|
|-b BENCHMARK, --benchmark=BENCHMARK|
|Set the file ID of the benchmark files. If BENCHMARK is in the format t:ID, then the test files with the corresponding ID are used. This allows two sets of tests to be compared. Default: specified in the [user] section of the userconfig file.|
|-c CATEGORY, --category=CATEGORY|
|Select the category/group of tests. Can be specified multiple times. Wildcards or parent directories can be used to select multiple directories by their path. Default: use the _default_ category if run is an action unless make-benchmarks is an action. All other cases use the _all_ category by default. The _default_ category contains all tests unless otherwise set in the jobconfig file.|
|-e EXECUTABLE, --executable=EXECUTABLE|
|Set the executable(s) to be used to run the tests. Can be a path or name of an option in the userconfig file, in which case all test programs are set to use that value, or in the format program_name=value, which affects only the specified program. Only relevant to the run action. Default: exe variable set for each program listed in the userconfig file.|
|Run tests that were not were not run in the previous testcode run. Only relevant to the recheck action. Default: False.|
|-i, --insert||Insert the new benchmark into the existing list of benchmarks in userconfig rather than overwriting it. Only relevant to the make-benchmarks action. Default: False.|
|Set path to the job configuration file. Default: jobconfig.|
|Override/add setting to jobconfig. Takes three arguments. Format: section_name option_name value. Default: none.|
|Set the age (in days) of files to remove. Only relevant to the tidy action. Default: 14 days.|
|-p NPROCS, --processors=NPROCS|
|Set the number of processors to run each test on. Only relevant to the run action. Default: run tests as serial jobs.|
|-q, --quiet||Print only minimal output. Default: False.|
|-s QUEUE_SYSTEM, --submit=QUEUE_SYSTEM|
|Submit tests to a queueing system of the specified type. Only PBS system is currently implemented. Only relevant to the run action. Default: none.|
|-t TEST_ID, --test-id=TEST_ID|
|Set the file ID of the test outputs. If TEST_ID is in the format b:ID, then the benchmark files with the corresponding ID are used. This allows two sets of benchmarks to be compared. Default: unique filename based upon date if running tests and most recent test_id if comparing tests.|
|Set the total number of processors to use to run as many tests as possible at the same time. Relevant only to the run option. Default: run all tests concurrently run if –submit is used; run tests sequentially otherwise.|
|Set path to the user configuration file. Default: userconfig.|
|Override/add setting to userconfig. Takes three arguments. Format: section_name option_name value. Default: none.|
|-v, --verbose||Increase verbosity of output. Can be specified up to two times. The default behaviour is to print out the test and its status. (See the –quiet option to suppress even this.) Specify -v or –verbose once to show (if relevant) which data values caused warnings or failures. Specify -v or –verbose twice to see all (external) commands run and all data extracted from running the tests. Using the maximum verbosity level is highly recommended for debugging.|
1 if one or more tests fail (run and compare actions only) and 0 otherwise.
Modified BSD License. See LICENSE in the source code for more details.