@@ -26,21 +26,44 @@ discovered tests to include only those in the `ENABLED_TESTS` list. This
2626environment 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+
2936Creating tests
3037--------------
3138
3239A test is defined by a directory which contains a shell script called "test.sh";
3340the test succeeds when the shell script does. When run as part of the suite,
3441these "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
3647Tests 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
3849variable "SAW", pointing to the corresponding executable, and with appropriate
3950Java classpaths included. It's a good idea to include a README in each test
4051directory.
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+
4262If the test directory name starts with "test", and the directory name is not
4363included in the ` disabled_tests.txt ` file or ` DISABLED_TESTS ` environment
4464variable, then the test is run by default. Only default tests are run on the
4565build slaves. When disabling a test by default, explain why in that test's
4666README.
67+
68+ For tests related to issues, use the issue number in the directory name,
69+ like ` test2122 ` .
0 commit comments