Skip to content

Commit 61714c3

Browse files
committed
[ cleanup ] Even more sharing!
1 parent 8985324 commit 61714c3

File tree

10 files changed

+56
-17
lines changed

10 files changed

+56
-17
lines changed

tests/Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ GHC_EXEC ?= ghc
33
CABAL ?= cabal
44
CABAL_OPTIONS ?= --with-compiler $(GHC_EXEC)
55

6-
runtests: runtests.agda
7-
rm -f _build/runtests
8-
rm -f _build/MAlonzo/Code/Qruntests*
9-
$(AGDA) --compile-dir=_build/ -c --ghc-dont-call-ghc runtests.agda
10-
$(CABAL) build $(CABAL_OPTIONS)
6+
AGDA_BUILD_DIR = _config/_build
7+
CABAL_BUILD_DIR = _config/dist-newstyle
118

12-
test: runtests
13-
$(CABAL) exec $(CABAL_OPTIONS) runtests -- $(AGDA_EXEC) $(INTERACTIVE) --timing --failure-file failures --only $(only)
9+
./runtests: admin/runtests/runtests.agda
10+
cd admin/runtests && sh run
1411

12+
test: ./runtests
13+
./runtests "$(AGDA)" $(INTERACTIVE) --timing --failure-file failures --only $(only)
1514

16-
retest: runtests
17-
$(CABAL) exec $(CABAL_OPTIONS) runtests -- $(AGDA_EXEC) $(INTERACTIVE) --timing --failure-file failures --only-file failures --only $(only)
15+
16+
retest: ./runtests
17+
./runtests "$(AGDA)" $(INTERACTIVE) --timing --failure-file failures --only-file failures --only $(only)

tests/_config/config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ goldenTest () {
4040
ln -sf "$CABAL_BUILD_DIR" dist-newstyle
4141

4242
# Compile the Agda module and build the generated code
43-
$AGDA --compile-dir=_build -c --ghc-dont-call-ghc Main.agda > logs/agda-build
43+
$AGDA --library-file=../../_config/libraries --compile-dir=_build -c --ghc-dont-call-ghc Main.agda > logs/agda-build
4444
cabal build "$TEST_NAME" --with-compiler "$GHC_EXEC" > logs/cabal-build
4545

4646
# Run the test

tests/_config/libraries

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../standard-library.agda-lib

tests/_config/template.agda-lib

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: TEST_NAME
2-
include: ../../../src/ .
2+
include: .
3+
depend: standard-library
34
flags:
45
--warning=noUnsupportedIndexedMatch

tests/admin/runtests/run

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
13+
TEST_NAME=runtests
14+
15+
# Specialise template agda-lib
16+
sed "s/TEST_NAME/$TEST_NAME/g" ../../_config/template.agda-lib > "$TEST_NAME".agda-lib
17+
18+
# Set up clean logs directory
19+
rm -rf logs/
20+
mkdir logs
21+
22+
# Use shared directories to avoid rechecking stdlib modules
23+
AGDA_BUILD_DIR=../../_config/_build
24+
CABAL_BUILD_DIR=../../_config/dist-newstyle
25+
26+
mkdir -p "$AGDA_BUILD_DIR"
27+
ln -sf "$AGDA_BUILD_DIR" _build
28+
mkdir -p "$CABAL_BUILD_DIR"
29+
ln -sf "$CABAL_BUILD_DIR" dist-newstyle
30+
31+
# Compile the Agda module and build the generated code
32+
$AGDA --library-file ../../_config/libraries --compile-dir=_build -c --ghc-dont-call-ghc runtests.agda > logs/agda-build
33+
cabal build "$TEST_NAME" --with-compiler "$GHC_EXEC" > logs/cabal-build
34+
35+
# Copy the executable to the test root directory
36+
cp $(find dist-newstyle/ -name "runtests" -type f) ../../
37+
38+
# Clean up after ourselves
39+
rm "$TEST_NAME".agda-lib
40+
rm _build
41+
rm dist-newstyle
File renamed without changes.
File renamed without changes.

tests/data/appending/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ mkdir -p "$CABAL_BUILD_DIR"
2020
ln -sf "$CABAL_BUILD_DIR" dist-newstyle
2121

2222
# Compile the Agda module and build the generated code
23-
$1 --compile-dir=_build -c --ghc-dont-call-ghc Main.agda > logs/agda-build
23+
$1 --library-file ../../_config/libraries --compile-dir=_build -c --ghc-dont-call-ghc Main.agda > logs/agda-build
2424
cabal build "$TEST_NAME" --with-compiler "$GHC_EXEC" > logs/cabal-build
2525

2626
# Run the test

tests/standard-library-tests.agda-lib

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/system/environment/run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ mkdir -p "$CABAL_BUILD_DIR"
2121
ln -sf "$CABAL_BUILD_DIR" dist-newstyle
2222

2323
# Compile the Agda module and build the generated code
24-
$1 --compile-dir=_build -c --ghc-dont-call-ghc Main.agda > logs/agda-build
24+
$1 --library-file ../../_config/libraries --compile-dir=_build -c --ghc-dont-call-ghc Main.agda > logs/agda-build
2525
cabal build "$TEST_NAME" --with-compiler "$GHC_EXEC" > logs/cabal-build
2626

2727
# Run the test

0 commit comments

Comments
 (0)