Skip to content

Commit 74114fb

Browse files
committed
[ doc ] adding a README file
1 parent 61714c3 commit 74114fb

File tree

7 files changed

+58
-30
lines changed

7 files changed

+58
-30
lines changed

tests/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Running the test suite
2+
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+
7+
```shell
8+
AGDA_EXEC=agda-2.6.4 GHC_EXEC=ghc-9.2.8 make testsuite
9+
```
10+
11+
12+
# Structure of the test suite
13+
14+
## Configuration
15+
16+
The Agda & GHC version numbers the stdlib is tested against
17+
are specified in [_config/version-numbers.sh](_config/version-numbers.sh)
18+
19+
## Test runner
20+
21+
The test runner is defined in [admin/runtests/](admin/runtests/).
22+
It is compiled using an ad-hoc [run](admin/runtests/run) file using
23+
the shared configuration and the resulting executable is copied to
24+
the root of the tests directory.
25+
26+
If you want to add new tests, you need to list them in
27+
[runtests.agda](admin/runtests/runtests.agda).
28+
29+
## Test dependencies
30+
31+
The external dependencies of each test are spelt out in:
32+
33+
* either the generic [_config/template.cabal](_config/template.cabal) cabal file
34+
if they don't need any additional dependencies
35+
* or the test-specific cabal file (e.g. [data/appending/appending.cabal](data/appending/appending.cabal)) otherwise
36+
37+
You may need to bump these dependencies when changing
38+
the version of the compiler backend we build against.
39+
40+
# Updating the test suite
41+
42+
1. Update [_config/version-numbers.sh](_config/version-numbers.sh)
43+
2. Update the command listing explicit version numbers at the top of this README
44+
3. Update bounds in [_config/template.cabal](_config/template.cabal)
45+
as well as all the test-specific cabal files in the X/Y/ subdirectories
46+
4. Update [../.github/workflows/ci-ubuntu.yml](../.github/workflows/ci-ubuntu.yml)
47+
to run the continuous integration with the new GHC and/or Agda versions.

tests/_config/config.sh

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,12 @@
55
# It provides a number of default config options corresponding
66
# to the compiler versions the stdlib is being tested with
77
#
8-
# Usage: . PATH/TO/config.sh
8+
# Usage: . ../../config.sh
99

1010
set -e
1111

12-
if [ -z ${AGDA_EXEC} ]; then
13-
export AGDA_EXEC=agda-2.6.4
14-
fi
15-
16-
if [ -z ${GHC_EXEC} ]; then
17-
export GHC_EXEC=ghc-9.2.8
18-
fi
12+
# Ugh, paths are relative to the script sourcing this file!
13+
. ../../_config/version-numbers.sh
1914

2015
goldenTest () {
2116

tests/config.sh renamed to tests/_config/version-numbers.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
# It provides a number of default config options corresponding
66
# to the compiler versions the stdlib is being tested with
77
#
8-
# Usage: . PATH/TO/config.sh
9-
10-
set -e
8+
# Usage: . PATH/TO/version-numbers.sh
119

1210
if [ -z ${AGDA_EXEC} ]; then
1311
export AGDA_EXEC=agda-2.6.4

tests/admin/runtests/run

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
#!/bin/sh
2-
3-
set -e
4-
5-
if [ -z ${AGDA_EXEC} ]; then
6-
export AGDA_EXEC=agda-2.6.4
7-
fi
8-
9-
if [ -z ${GHC_EXEC} ]; then
10-
export GHC_EXEC=ghc-9.2.8
11-
fi
12-
131
TEST_NAME=runtests
142

3+
# Use the shared version numbers
4+
. ../../_config/version-numbers.sh
5+
156
# Specialise template agda-lib
167
sed "s/TEST_NAME/$TEST_NAME/g" ../../_config/template.agda-lib > "$TEST_NAME".agda-lib
178

tests/admin/runtests/runtests.cabal

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ build-type: Simple
55
description: Building the test runner
66
license: MIT
77

8-
tested-with:
9-
GHC == 9.2.8
10-
118
common common-build-parameters
129
default-language:
1310
Haskell2010

tests/data/appending/run

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
TEST_NAME=appending
22

3-
# Get configuration information
4-
. ../../_config/config.sh
3+
# Use the shared version numbers
4+
. ../../_config/version-numbers.sh
55

66
# Specialise template agda-lib
77
sed "s/TEST_NAME/$TEST_NAME/g" ../../_config/template.agda-lib > "$TEST_NAME".agda-lib

tests/system/environment/run

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
TEST_NAME=environment
22

3-
# Get configuration information
4-
. ../../_config/config.sh
3+
# Use the shared version numbers
4+
. ../../_config/version-numbers.sh
55

66
# Specialise template agda-lib & cabal files
77
sed "s/TEST_NAME/$TEST_NAME/g" ../../_config/template.agda-lib > "$TEST_NAME".agda-lib

0 commit comments

Comments
 (0)