@@ -58,12 +58,12 @@ print statements and code checking that data structures are as expected.
58
58
\subsection compilation-and-development-subsection-regression-tests Regression tests
59
59
60
60
The 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
62
62
of these contains multiple test directories, with names describing
63
63
what they test. When there are multiple tests in a test directory then
64
64
they should all test very similar aspects of the program's behaviour. Each
65
65
test 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
67
67
to run, what output is expected and so on. The test framework is a
68
68
Perl script,
69
69
[ 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
80
80
81
81
If you have compiled using ` make ` then you can run the regression tests
82
82
using ` 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 ` .
84
86
85
87
If you have not compiled using ` make ` then this won't work, because the
86
88
makefile 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.
109
111
110
112
\subsubsection compilation-and-development-subsubsection-running-regression-tests-directly-with-test-pl Running regression tests directly with ` test.pl `
111
113
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):
114
120
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.
116
132
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
-
121
133
122
134
\subsection compilation-and-development-subsection-unit-tests Unit tests
123
135
0 commit comments