|
1 | | -Test suite |
2 | | -========== |
| 1 | +# Running the test suite |
3 | 2 |
|
4 | | -Building the library |
5 | | -#################### |
| 3 | +You can run the test suite by going back to the main project directory |
| 4 | +and running (change accordingly if you have the right versions of Agda |
| 5 | +& GHC installed but the executable names are different). |
6 | 6 |
|
7 | | -You can test the building of the entire library by running the following command from the top-level directory of the library: |
8 | | -```bash |
9 | | -cabal run GenerateEverything -- --include-deprecated |
10 | | -agda -Werror +RTS -M5G -H3.5G -A128M -RTS -i. -isrc -idoc -WnoUserWarning Everything.agda |
| 7 | +```shell |
| 8 | +AGDA_EXEC=agda-2.6.4 GHC_EXEC=ghc-9.2.8 make testsuite |
11 | 9 | ``` |
12 | 10 |
|
13 | | -Golden tests |
14 | | -############ |
| 11 | +# Structure of the test suite |
15 | 12 |
|
16 | | -Setup |
17 | | ------ |
| 13 | +## Test case |
18 | 14 |
|
19 | | -The golden tests need the `clock` package from Cabal to run. |
20 | | -This can be installed via: |
21 | | -```bash |
22 | | -cabal v1-install --ghc-options='-O1 +RTS -M6G -RTS' clock |
23 | | -``` |
| 15 | +Each test case is under 2 levels of nesting (this is hard-coded) |
| 16 | +and should comprise: |
24 | 17 |
|
25 | | -Running |
26 | | -------- |
| 18 | +1. A `Main.agda` file containing a `main` entrypoint |
| 19 | +2. An `expected` file containing the expected output of running `Main` |
| 20 | +3. A `run` file describing how to run `Main` (most likely implemented |
| 21 | + using the `goldenTest` function defined in |
| 22 | + [_config/config.sh](_config/config.sh). |
| 23 | +4. Optionally, an `input` file for the stdin content to feed to |
| 24 | + the executable obtained by compiling `Main`. |
27 | 25 |
|
28 | | -The golden tests can be run from the top-level directory of the library with the command: |
29 | | -```bash |
30 | | -make testsuite INTERACTIVE='' AGDA_EXEC='~/.cabal/bin/agda' |
31 | | -``` |
32 | | -This should take about 5 minutes to run. |
| 26 | +## Configuration |
| 27 | + |
| 28 | +The Agda & GHC version numbers the stdlib is tested against |
| 29 | +are specified in [_config/version-numbers.sh](_config/version-numbers.sh) |
| 30 | + |
| 31 | +## Test runner |
| 32 | + |
| 33 | +The test runner is defined in [admin/runtests/](admin/runtests/). |
| 34 | +It is compiled using an ad-hoc [run](admin/runtests/run) file using |
| 35 | +the shared configuration and the resulting executable is copied to |
| 36 | +the root of the tests directory. |
| 37 | + |
| 38 | +If you want to add new tests, you need to list them in |
| 39 | +the [runtests](admin/runtests/Main.agda) program. |
| 40 | + |
| 41 | +## Test dependencies |
| 42 | + |
| 43 | +The external dependencies of the whole test suite are spelt out in the generic |
| 44 | +[_config/template.cabal](_config/template.cabal) cabal file |
| 45 | + |
| 46 | +You may need to bump these dependencies when changing |
| 47 | +the version of the GHC compiler we build against. |
| 48 | + |
| 49 | +# Updating the test suite |
| 50 | + |
| 51 | +1. Update [_config/version-numbers.sh](_config/version-numbers.sh) |
| 52 | +2. Update the shell command listing explicit version numbers in the |
| 53 | + fenced code block at the top of this README |
| 54 | +3. Update bounds in [_config/template.cabal](_config/template.cabal) |
| 55 | +4. Update [../.github/workflows/ci-ubuntu.yml](../.github/workflows/ci-ubuntu.yml) |
| 56 | + to run the continuous integration with the new GHC and/or Agda versions. |
0 commit comments