Skip to content

Commit b0c2ecb

Browse files
authored
Merge pull request #2274 from GaloisInc/improve-intTest-readme
Add a few points to intTests/README that aren't written down anywhere
2 parents 3e9b4b6 + 91a4d5b commit b0c2ecb

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

intTests/README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,44 @@ discovered tests to include only those in the `ENABLED_TESTS` list. This
2626
environment variable is commonly used during development to run specific tests
2727
(which `cabal test` does not easily support).
2828

29+
You can in most cases run a single test locally with `SAW=path-to-saw
30+
bash test.sh` where `path-to-saw` is the SAW executable to test.
31+
If you don't have your shell configured to report exit status, remember
32+
to check that explicitly afterwards with `echo $?` -- not all the tests
33+
will necessary produce overt errors on failure, especially if something
34+
is wrong and cases that should be failing aren't.
35+
2936
Creating tests
3037
--------------
3138

3239
A test is defined by a directory which contains a shell script called "test.sh";
3340
the test succeeds when the shell script does. When run as part of the suite,
3441
these "test.sh" scripts are interpreted by `bash`.
42+
The convention (not yet broadly enforced) is that these scripts do not have
43+
a `#!` header and are not marked executable; they are run explicitly with
44+
`bash test.sh` by the test infrastructure.
45+
This avoids assorted problems on Windows.
3546

3647
Tests generally consist of a SAW script that is expected to succeed together
37-
with the artifacts that are needed. The test suite defines the environment
48+
with the artefacts that are needed. The test suite defines the environment
3849
variable "SAW", pointing to the corresponding executable, and with appropriate
3950
Java classpaths included. It's a good idea to include a README in each test
4051
directory.
4152

53+
For tests that need binary artefacts (Java bytecode, LLVM bitcode) or
54+
things that might as well be (linked-mir.json from mir-json), include
55+
the corresponding source and a (gmake) Makefile that builds the
56+
artefact, as well as the artefact itself.
57+
Indicate other provenance information in the Makefile (e.g. LLVM version and
58+
host type), and to what extent this is expected to affect the utility of the
59+
artefact for testing.
60+
`test2122` is a good example to crib from.
61+
4262
If the test directory name starts with "test", and the directory name is not
4363
included in the `disabled_tests.txt` file or `DISABLED_TESTS` environment
4464
variable, then the test is run by default. Only default tests are run on the
4565
build slaves. When disabling a test by default, explain why in that test's
4666
README.
67+
68+
For tests related to issues, use the issue number in the directory name,
69+
like `test2122`.

0 commit comments

Comments
 (0)