@@ -58,12 +58,12 @@ print statements and code checking that data structures are as expected.
5858\subsection compilation-and-development-subsection-regression-tests Regression tests
5959
6060The regression tests are contained in ` regression/ ` and ` jbmc/regression/ ` .
61- Inside these folders there is a directory for each of the tools/ modules. Each
61+ Inside these folders there is a directory for each of the modules. Each
6262of these contains multiple test directories, with names describing
6363what they test. When there are multiple tests in a test directory then
6464they should all test very similar aspects of the program's behaviour. Each
6565test directory contains input files and one or more test description files,
66- which have the ending ` .desc ` . The test description files describe what command
66+ which have the ending ` .desc ` . The test description files specify what command
6767to run, what output is expected and so on. The test framework is a
6868Perl script,
6969[ test.pl] ( https://github.com/diffblue/cbmc/blob/develop/regression/test.pl ) ,
@@ -80,7 +80,9 @@ succeed), `FUTURE` (will succeed when a planned feature is added) or
8080
8181If you have compiled using ` make ` then you can run the regression tests
8282using ` make test ` . Run it from ` regression/ ` to run all the regression tests,
83- or any of its subfolders to just run the tests in that subfolder.
83+ or any of its subfolders to just run the tests for that module. The number
84+ of tests that are run in parallel can be controlled through the environment
85+ variable ` TESTPL_JOBS ` .
8486
8587If you have not compiled using ` make ` then this won't work, because the
8688makefile is expecting to find binaries like ` cbmc ` and ` jbmc ` in the source
@@ -109,15 +111,25 @@ list which tests it will run without actually running them.
109111
110112\subsubsection compilation-and-development-subsubsection-running-regression-tests-directly-with-test-pl Running regression tests directly with ` test.pl `
111113
112- In a directory corresponding to a tool or module, you can directly run a
113- test directory as follows:
114+ It can be useful to run a single test folder in isolation. This can be done by
115+ running ` test.pl ` directly. The way that ` test.pl ` is run varies between the
116+ different modules, and can be ascertained by looking at the ` test ` target in
117+ the makefile. The simple case is when there isn't a file called ` chain.sh ` .
118+ Then you can directly run ` test.pl ` on a single test folder with the
119+ following command (from the module directory):
114120
115- ../test.pl -c PATH_TO_CBMC_FROM_DESC_FILE TEST_DIR
121+ ../test.pl -p -c <absolute-path-to-binary> <test-folder>
122+
123+ ` -p ` makes it print a log of failed tests and ` -c ` tells it where to find the
124+ binary to run (the path does not have to be absolute, but it is recommended).
125+ If ` <test-folder> ` is not provided then all test directories are run. The
126+ ` --help ` option lists all command line options, including ` -j ` for running
127+ multiple tests in parallel and ` -C ` , ` -T ` , ` -F ` and ` -K ` for controlling
128+ whether ` CORE ` , ` THOROUGH ` , ` FUTURE ` or ` KNOWNBUG ` tests are run.
129+
130+ When there is a file called ` chain.sh ` then ` test.pl ` is called with
131+ ` -c ../chain.sh ` , followed by arguments which vary from module to module.
116132
117- Note that ` PATH_TO_CBMC_FROM_DESC_FILE ` should either be absolute or be
118- relative to the location of the test description files. If ` TEST_DIR ` is
119- not provided then all test directories are run.
120-
121133
122134\subsection compilation-and-development-subsection-unit-tests Unit tests
123135
0 commit comments