File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 77#
88# Usage: . ../../config.sh
99
10- set -e
10+ set -eu
1111
1212# Ugh, paths are relative to the script sourcing this file!
1313. ../../_config/version-numbers.sh
@@ -17,6 +17,14 @@ goldenTest () {
1717 AGDA=$1
1818 TEST_NAME=$2
1919
20+ # Remember whether the script has an input -- ugh
21+ if [ -f input ]; then
22+ HAS_INPUT=" true"
23+ else
24+ touch input
25+ HAS_INPUT=" false"
26+ fi
27+
2028 # Specialise template agda-lib & cabal files
2129 sed " s/TEST_NAME/$TEST_NAME /g" ../../_config/template.agda-lib > " $TEST_NAME " .agda-lib
2230 sed " s/TEST_NAME/$TEST_NAME /g" ../../_config/template.cabal > " $TEST_NAME " .cabal
@@ -39,9 +47,12 @@ goldenTest () {
3947 cabal build " $TEST_NAME " --with-compiler " $GHC_EXEC " > logs/cabal-build
4048
4149 # Run the test
42- cabal exec -v0 " $TEST_NAME " --with-compiler " $GHC_EXEC " > output
50+ cabal exec -v0 " $TEST_NAME " --with-compiler " $GHC_EXEC " < input > output
4351
4452 # Clean up after ourselves
53+ if ! " $HAS_INPUT " ; then
54+ rm input
55+ fi
4556 rm " $TEST_NAME " .cabal
4657 rm " $TEST_NAME " .agda-lib
4758 rm _build
You can’t perform that action at this time.
0 commit comments