-
Notifications
You must be signed in to change notification settings - Fork 274
Update compilation and development docs #2789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update compilation and development docs #2789
Conversation
Instructions for compiling CBMC using makefiles are | ||
available in | ||
[COMPILING.md](https://github.com/diffblue/cbmc/blob/develop/COMPILING.md#what-architecture) | ||
in the root of the CBMC repository. They cover linux, Solaris 11, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linux
|
||
### Regression tests ### | ||
There is experimental support for compiling using CMake. Instructions are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still experimental??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just copying what it says in COMPILING.md. I'll update both places.
There is experimental support for compiling using CMake. Instructions are | ||
available in | ||
[COMPILING.md](https://github.com/diffblue/cbmc/blob/develop/COMPILING.md#working-with-cmake-experimental) | ||
in the root of the CBMC repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One note here is that cmake currently always compiles CBMC and JBMC, whereas with Makefiles you can compile CBMC without JBMC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surely with CMake targets you can just compile CBMC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked @smowton and he agreed that you can compile just CBMC using CMake targets, so unless I hear otherwise I won't add anything about this.
`regression/` there is a directory for each of the tools/modules. Each of | ||
these contains multiple test directories, with names describing | ||
what they test. When there are multiple tests in a test directory then | ||
they should all be testing the same thing. Each test directory contains |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is "thing" here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have the same comment. Maybe be more specific about what a "thing" is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated it to "When there are multiple tests in a test directory then they should be testing very similar aspects of the program's behaviour."
to run, what output is expected and so on. The test framework is an in-house | ||
Perl script, | ||
[test.pl](https://github.com/diffblue/cbmc/blob/develop/regression/test.pl). | ||
To run all the tests in a directory corresponding to a tool or module: | ||
|
||
../test.pl -c PATH_TO_CBMC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nobody does that by hand. You usually run it through make.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be careful when using the term "nobody" :-) - legitimate uses include running selected tests. But arguably the text could recommend the use of make test
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everyone I know runs test.pl
directly, though as @tautschnig says it's normally for running a single test. I will add instructions for make test
.
|
||
If you have compiled CBMC using CMake then another way to run the same tests | ||
is through `CTest`. From the build directory, the command `ctest -V -L CORE` | ||
will run all of the tests that are run in CI. `-V` makes it print out more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure that is a good definition: "all of the tests that are run in CI"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative suggestion: Runs all tests labelled CORE in the desc files and unit tests. I think the current isn't correct as aren't THOROUGH
tests also run on CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THOROUGH
tests aren't run in CI
The `–help` option gives instructions for use and the | ||
format of the description files. | ||
The `--help` option to `test.pl` gives instructions for use and outlines the | ||
format of the test description files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test categories CORE, KNOWNBUG, etc should be explained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the labels for excluding specific tests need some explanation.
|
||
If you have compiled CBMC using CMake then another way to run the same tests | ||
is through `CTest`. From the build directory, the command `ctest -V -L CORE` | ||
will run all of the tests that are run in CI. `-V` makes it print out more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative suggestion: Runs all tests labelled CORE in the desc files and unit tests. I think the current isn't correct as aren't THOROUGH
tests also run on CI?
is through `CTest`. From the build directory, the command `ctest -V -L CORE` | ||
will run all of the tests that are run in CI. `-V` makes it print out more | ||
useful output and `-L CORE` makes it only run tests that have been tagged | ||
`CORE`. `-R regular_expression` can be used to limit which tests are run, and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth mentioning this can't be used to for example run a specific .desc
file, only one of the top level folders.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there actually a way to run individual tests in CMake? Not knowing how to work with the tests is one of the reasons I've largely refrained from adopting CMake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that what we add to CTest is one command per module/tool folder, so CTest doesn't know how to run just one folder within one of those.
base branch: | ||
|
||
scripts/run_lint.sh <base-branch> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd give an example base-branch just because I don't think its meaning is necessarily well understood.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This document should keep evolving, but it's a good start. Only minor comments.
@@ -3,43 +3,106 @@ | |||
|
|||
\author Martin Brain, Peter Schrammel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@owen-jones-diffblue add your name to the author's list or remove it. In general I don't think file author lists make any sense.
they should all be testing the same thing. Each test directory contains | ||
input files and one or more test description files, | ||
which have the ending `.desc`. The test description files describe what command | ||
to run, what output is expected and so on. The test framework is an in-house |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛏️ Remove in-house
. Most of the code is "in-house" (and that part is not one we're particularly proud of).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you accept "hand-rolled"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine
`regression/` there is a directory for each of the tools/modules. Each of | ||
these contains multiple test directories, with names describing | ||
what they test. When there are multiple tests in a test directory then | ||
they should all be testing the same thing. Each test directory contains |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have the same comment. Maybe be more specific about what a "thing" is.
c87d30f
to
f88a065
Compare
I've pushed a PR addressing many of the comments. Work left:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A huge improvement - thanks. The suggested outstanding stuff would of course be good, but I think this is already a useful step forward.
will run all of the tests that are labelled CORE in the desc files and unit | ||
tests. `-V` makes it print out more | ||
useful output and `-L CORE` makes it only run tests that have been tagged | ||
`CORE`. `-R regular_expression` can be used to limit which tests are run, and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 provide an example
ctest -L CORE -V -R goto-analyzer
will run all the CORE
tests in regression/goto-analyzer
@owen-jones-diffblue, please amend the PR to cover the two remaining items. Then it looks good to go. |
I've addressed the final review comments. I'm aware there are still some areas where this could be improved, e.g. running the tests using make or directly. I am not familiar with those areas, so either people should suggest specific things that should be mentioned in review comments, or these areas should be improved by others who are more familiar with them in follow-up PRs. |
@@ -1,45 +1,149 @@ | |||
\ingroup module_hidden | |||
\page compilation-and-development Compilation and Development | |||
|
|||
\author Martin Brain, Peter Schrammel | |||
\author Martin Brain, Peter Schrammel, Owen Jones |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen @peterschrammel comment on this elsewhere: are authors being recorded or removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the conclusion was to record the authors - there were a few arguments for it (more difficult to git praise these pages, recognition of doc contributors).
No description provided.