diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index e35482371..92fe1d80a 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -216,8 +216,8 @@ jobs: stack: ${{ matrix.plan.stack }} run: | export PATH=~/.local/bin:$PATH - COLUMNS=80 $stack exec -- shelltest --execdir -j16 hledger/test bin -x /_ -x /addons - # XXX func tests in bin are run only with GHC 8.2 for now + COLUMNS=80 $stack exec -- shelltest --execdir -j16 hledger/test bin/_scripts8.2.test -x /_ -x /addons + # XXX run only the bin/ func tests corresponding to the GHC version enabled above, for now - name: Test haddock generation env: diff --git a/bin/_scripts8.2.test b/bin/_scripts8.2.test new file mode 100644 index 000000000..eec8c0e0a --- /dev/null +++ b/bin/_scripts8.2.test @@ -0,0 +1,18 @@ +# Functional tests for the add-on scripts in this directory. +# Keep synced: compile.sh, scripts*.test, hledger-*.hs ... + +# Check that these ones still compile with this version of hledger. +# stdout and exit code are ignored for cleaner failure output. +# +# The tests below are hard coded to one GHC version. +# See also scriptsX.Y.test, used by our CI workflows which run other GHC versions +# (so they don't install and build for a whole extra GHC version). +# +# $ ./compile.sh >/dev/null +$ stack --stack-yaml ../stack8.2.yaml ghc hledger-balance-as-budget.hs >/dev/null || true +$ stack --stack-yaml ../stack8.2.yaml ghc hledger-check-fancyassertions.hs >/dev/null || true +$ stack --stack-yaml ../stack8.2.yaml ghc hledger-check-tagfiles.hs >/dev/null || true +$ stack --stack-yaml ../stack8.2.yaml ghc hledger-combine-balances.hs >/dev/null || true +$ stack --stack-yaml ../stack8.2.yaml ghc hledger-print-location.hs >/dev/null || true +$ stack --stack-yaml ../stack8.2.yaml ghc hledger-smooth.hs >/dev/null || true +$ stack --stack-yaml ../stack8.2.yaml ghc hledger-swap-dates.hs >/dev/null || true diff --git a/bin/compile.sh b/bin/compile.sh index bebf391e9..7ef337b7b 100755 --- a/bin/compile.sh +++ b/bin/compile.sh @@ -1,6 +1,6 @@ #!/bin/sh # Compile all add-on scripts in this directory. -# Keep synced: compile.sh, scripts.test, hledger-check-fancyassertions.hs. +# Keep synced: compile.sh, scripts*.test, hledger-*.hs ... cd "$(dirname "$0")" || exit diff --git a/bin/hledger-check-fancyassertions.hs b/bin/hledger-check-fancyassertions.hs index 71df7ad99..fc2d8cb0f 100755 --- a/bin/hledger-check-fancyassertions.hs +++ b/bin/hledger-check-fancyassertions.hs @@ -18,9 +18,9 @@ -- -- This setup is adapted for some current limitations of stack's -- ghc/runghc/script commands. Unfortunately it requires repeating --- package dependencies, to the extent they are required, in three +-- package dependencies, to the extent they are required, in multiple -- places. --- Keep synced: compile.sh, scripts.test, hledger-check-fancyassertions.hs. +-- Keep synced: compile.sh, scripts*.test, hledger-*.hs ... {- ``` diff --git a/bin/scripts.test b/bin/scripts.test index 0b0681451..f7aab35e8 100644 --- a/bin/scripts.test +++ b/bin/scripts.test @@ -1,20 +1,18 @@ # Functional tests for the add-on scripts in this directory. -# Keep synced: compile.sh, scripts.test, hledger-check-fancyassertions.hs. +# Keep synced: compile.sh, scripts*.test, hledger-*.hs ... # Check that these ones still compile with this version of hledger. # stdout and exit code are ignored for cleaner failure output. # -# Our CI workflows run with multiple GHC versions, but the tests below -# are hard coded to one version. We don't want them to cause a whole -# extra GHC version to be installed and built for. -# XXX For now, we hard code GHC 8.2 here, same as the linux/pull request CI, -# and run these tests only there. +# The tests below are hard coded to one GHC version. +# See also scriptsX.Y.test, used by our CI workflows which run other GHC versions +# (so they don't install and build for a whole extra GHC version). # # $ ./compile.sh >/dev/null -$ stack --stack-yaml ../stack8.2.yaml ghc hledger-balance-as-budget.hs >/dev/null || true -$ stack --stack-yaml ../stack8.2.yaml ghc hledger-check-fancyassertions.hs >/dev/null || true -$ stack --stack-yaml ../stack8.2.yaml ghc hledger-check-tagfiles.hs >/dev/null || true -$ stack --stack-yaml ../stack8.2.yaml ghc hledger-combine-balances.hs >/dev/null || true -$ stack --stack-yaml ../stack8.2.yaml ghc hledger-print-location.hs >/dev/null || true -$ stack --stack-yaml ../stack8.2.yaml ghc hledger-smooth.hs >/dev/null || true -$ stack --stack-yaml ../stack8.2.yaml ghc hledger-swap-dates.hs >/dev/null || true +$ stack ghc hledger-balance-as-budget.hs >/dev/null || true +$ stack ghc hledger-check-fancyassertions.hs >/dev/null || true +$ stack ghc hledger-check-tagfiles.hs >/dev/null || true +$ stack ghc hledger-combine-balances.hs >/dev/null || true +$ stack ghc hledger-print-location.hs >/dev/null || true +$ stack ghc hledger-smooth.hs >/dev/null || true +$ stack ghc hledger-swap-dates.hs >/dev/null || true