1
1
\ingroup module_hidden
2
2
\page compilation-and-development Compilation and Development
3
3
4
- \author Martin Brain, Peter Schrammel
4
+ \author Martin Brain, Peter Schrammel, Owen Jones
5
5
6
6
\section compilation-and-development-section-compilation Compilation
7
7
@@ -14,13 +14,13 @@ The CBMC source code is available on
14
14
Instructions for compiling CBMC using makefiles are
15
15
available in
16
16
[ COMPILING.md] ( https://github.com/diffblue/cbmc/blob/develop/COMPILING.md#what-architecture )
17
- in the root of the CBMC repository. They cover linux , Solaris 11,
17
+ in the root of the CBMC repository. They cover Linux , Solaris 11,
18
18
FreeBSD 11, MacOS X and Windows.
19
19
20
20
21
21
\subsection compilation-and-development-subsection-cmake-files CMake files
22
22
23
- There is experimental support for compiling using CMake. Instructions are
23
+ There is also support for compiling using CMake. Instructions are
24
24
available in
25
25
[ COMPILING.md] ( https://github.com/diffblue/cbmc/blob/develop/COMPILING.md#working-with-cmake-experimental )
26
26
in the root of the CBMC repository.
@@ -55,26 +55,31 @@ print statements and code checking that data structures are as expected.
55
55
56
56
\subsection compilation-and-development-subsection-regression-tests Regression tests
57
57
58
- The regression tests are contained in the ` regression/ ` folder. Inside
59
- ` regression/ ` there is a directory for each of the tools/modules. Each of
60
- these contains multiple test directories, with names describing
58
+ The regression tests are contained in ` regression/ ` and ` jbmc/regression/ ` .
59
+ Inside these folders there is a directory for each of the tools/modules. Each
60
+ of these contains multiple test directories, with names describing
61
61
what they test. When there are multiple tests in a test directory then
62
- they should all be testing the same thing. Each test directory contains
63
- input files and one or more test description files,
62
+ they should be testing very similar aspects of the program's behaviour. Each
63
+ test directory contains input files and one or more test description files,
64
64
which have the ending ` .desc ` . The test description files describe what command
65
- to run, what output is expected and so on. The test framework is an in-house
65
+ to run, what output is expected and so on. The test framework is a
66
66
Perl script,
67
67
[ test.pl] ( https://github.com/diffblue/cbmc/blob/develop/regression/test.pl ) .
68
68
To run all the tests in a directory corresponding to a tool or module:
69
69
70
70
../test.pl -c PATH_TO_CBMC
71
71
72
72
The ` --help ` option to ` test.pl ` gives instructions for use and outlines the
73
- format of the test description files.
73
+ format of the test description files. Most importantly, the first word in a
74
+ test description file is its level, which is one of: ` CORE ` (should be run in
75
+ CI, should succeed), ` THOROUGH ` (takes too long to be run in CI, should
76
+ succeed), ` FUTURE ` (will succeed when a planned feature is added) or
77
+ ` KNOWNBUG ` (will succeed when a bug is fixed).
74
78
75
79
If you have compiled CBMC using CMake then another way to run the same tests
76
80
is through ` CTest ` . From the build directory, the command ` ctest -V -L CORE `
77
- will run all of the tests that are run in CI. ` -V ` makes it print out more
81
+ will run all of the tests that are labelled CORE in the desc files and unit
82
+ tests. ` -V ` makes it print out more
78
83
useful output and ` -L CORE ` makes it only run tests that have been tagged
79
84
` CORE ` . ` -R regular_expression ` can be used to limit which tests are run, and
80
85
` -N ` makes it lists which tests it will run without actually running them.
@@ -132,10 +137,10 @@ C++ code can be automatically reformatted in the correct way by running
132
137
\section compilation-and-development-section-linting Linting
133
138
134
139
There is also a linting script, ` scripts/cpplint.py ` . There is a wrapper
135
- script to run ` cpplint.py ` only on lines that have been changed from the
136
- base branch:
140
+ script to run ` cpplint.py ` only on lines that differ from another
141
+ branch, e.g. to run it on lines that have been changed from ` develop ` :
137
142
138
- scripts/run_lint.sh <base-branch>
143
+ scripts/run_lint.sh develop
139
144
140
145
There are also instructions for adding this as a git pre-commit hook in
141
146
[ CODING_STANDARD.md] ( https://github.com/diffblue/cbmc/blob/develop/CODING_STANDARD.md#pre-commit-hook-to-run-cpplint-locally ) .
0 commit comments