File tree Expand file tree Collapse file tree 3 files changed +35
-11
lines changed
Expand file tree Collapse file tree 3 files changed +35
-11
lines changed Original file line number Diff line number Diff line change @@ -22,15 +22,22 @@ goldenTest () {
2222 AGDA=$1
2323 TEST_NAME=$2
2424
25+ # Specialise template agda-lib & cabal files
2526 sed " s/TEST_NAME/$TEST_NAME /g" ../../_config/template.agda-lib > " $TEST_NAME " .agda-lib
2627 sed " s/TEST_NAME/$TEST_NAME /g" ../../_config/template.cabal > " $TEST_NAME " .cabal
2728
2829 # Set up clean logs directory
2930 rm -rf logs/
3031 mkdir logs
3132
32- # Use pre-existing build directory to avoid rechecking stdlib modules
33- ln -sf ../../_build _build
33+ # Use shared directories to avoid rechecking stdlib modules
34+ AGDA_BUILD_DIR=../../_config/_build
35+ CABAL_BUILD_DIR=../../_config/dist-newstyle
36+
37+ mkdir -p " $AGDA_BUILD_DIR "
38+ ln -sf " $AGDA_BUILD_DIR " _build
39+ mkdir -p " $CABAL_BUILD_DIR "
40+ ln -sf " $CABAL_BUILD_DIR " dist-newstyle
3441
3542 # Compile the Agda module and build the generated code
3643 $AGDA --compile-dir=_build -c --ghc-dont-call-ghc Main.agda > logs/agda-build
@@ -41,7 +48,7 @@ goldenTest () {
4148
4249 # Clean up after ourselves
4350 rm " $TEST_NAME " .cabal
44- rm -R dist-newstyle
45- rm -R _build/MAlonzo/Code/
46-
51+ rm " $TEST_NAME " .agda-lib
52+ rm _build
53+ rm dist-newstyle
4754}
Original file line number Diff line number Diff line change @@ -3,14 +3,21 @@ TEST_NAME=appending
33# Get configuration information
44. ../../_config/config.sh
55
6+ # Specialise template agda-lib
67sed "s/TEST_NAME/$TEST_NAME/g" ../../_config/template.agda-lib > "$TEST_NAME".agda-lib
78
89# Set up clean logs directory
910rm -rf logs/
1011mkdir logs
1112
12- # Use pre-existing build directory to avoid rechecking stdlib modules
13- ln -sf ../../_build _build
13+ # Use shared directories to avoid rechecking stdlib modules
14+ AGDA_BUILD_DIR=../../_config/_build
15+ CABAL_BUILD_DIR=../../_config/dist-newstyle
16+
17+ mkdir -p "$AGDA_BUILD_DIR"
18+ ln -sf "$AGDA_BUILD_DIR" _build
19+ mkdir -p "$CABAL_BUILD_DIR"
20+ ln -sf "$CABAL_BUILD_DIR" dist-newstyle
1421
1522# Compile the Agda module and build the generated code
1623$1 --compile-dir=_build -c --ghc-dont-call-ghc Main.agda > logs/agda-build
@@ -20,5 +27,6 @@ cabal build "$TEST_NAME" --with-compiler "$GHC_EXEC" > logs/cabal-build
2027cabal exec -v0 "$TEST_NAME" --with-compiler "$GHC_EXEC" < input > output
2128
2229# Clean up after ourselves
30+ rm "$TEST_NAME".agda-lib
2331rm -R dist-newstyle
2432rm -R _build/MAlonzo/Code/
Original file line number Diff line number Diff line change @@ -3,15 +3,22 @@ TEST_NAME=environment
33# Get configuration information
44. ../../_config/config.sh
55
6+ # Specialise template agda-lib & cabal files
67sed "s/TEST_NAME/$TEST_NAME/g" ../../_config/template.agda-lib > "$TEST_NAME".agda-lib
78sed "s/TEST_NAME/$TEST_NAME/g" ../../_config/template.cabal > "$TEST_NAME".cabal
89
910# Set up clean logs directory
1011rm -rf logs/
1112mkdir logs
1213
13- # Use pre-existing build directory to avoid rechecking stdlib modules
14- ln -sf ../../_build _build
14+ # Use shared directories to avoid rechecking stdlib modules
15+ AGDA_BUILD_DIR=../../_config/_build
16+ CABAL_BUILD_DIR=../../_config/dist-newstyle
17+
18+ mkdir -p "$AGDA_BUILD_DIR"
19+ ln -sf "$AGDA_BUILD_DIR" _build
20+ mkdir -p "$CABAL_BUILD_DIR"
21+ ln -sf "$CABAL_BUILD_DIR" dist-newstyle
1522
1623# Compile the Agda module and build the generated code
1724$1 --compile-dir=_build -c --ghc-dont-call-ghc Main.agda > logs/agda-build
@@ -21,5 +28,7 @@ cabal build "$TEST_NAME" --with-compiler "$GHC_EXEC" > logs/cabal-build
2128cabal exec -v0 "$TEST_NAME" --with-compiler "$GHC_EXEC" -- hello world > output
2229
2330# Clean up after ourselves
24- rm -R dist-newstyle
25- rm -R _build/MAlonzo/Code/
31+ rm "$TEST_NAME".cabal
32+ rm "$TEST_NAME".agda-lib
33+ rm _build
34+ rm dist-newstyle
You can’t perform that action at this time.
0 commit comments