Skip to content

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

Conversation

owen-mc-diffblue
Copy link
Contributor

No description provided.

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,
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still experimental??

Copy link
Contributor Author

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.
Copy link
Member

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is "thing" here?

Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Member

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.

Copy link
Collaborator

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.

Copy link
Contributor Author

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
Copy link
Member

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"

Copy link
Contributor

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?

Copy link
Contributor Author

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.
Copy link
Member

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.

Copy link
Member

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
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Collaborator

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.

Copy link
Contributor Author

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>
Copy link
Contributor

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.

Copy link
Contributor

@allredj allredj left a 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
Copy link
Contributor

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
Copy link
Contributor

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).

Copy link
Contributor Author

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"?

Copy link
Contributor Author

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
Copy link
Contributor

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.

@owen-mc-diffblue owen-mc-diffblue force-pushed the doc/compilation-and-development branch from c87d30f to f88a065 Compare August 23, 2018 16:32
@owen-mc-diffblue
Copy link
Contributor Author

I've pushed a PR addressing many of the comments. Work left:

  • how to run tests (make, directly, ctest)
  • test.pl arguments for excluding specific tests

Copy link
Contributor

@thk123 thk123 left a 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
Copy link
Contributor

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

@peterschrammel
Copy link
Member

@owen-jones-diffblue, please amend the PR to cover the two remaining items. Then it looks good to go.

@owen-mc-diffblue
Copy link
Contributor Author

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
Copy link
Collaborator

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?

Copy link
Member

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).

@peterschrammel peterschrammel merged commit 1dfc476 into diffblue:develop Aug 31, 2018
@owen-mc-diffblue owen-mc-diffblue deleted the doc/compilation-and-development branch September 3, 2018 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants