Skip to content

Commit

Permalink
Upgrade testscript to cabal v2 and use --keep-going
Browse files Browse the repository at this point in the history
Some caveats:

  * Cabal version in CI has been bumped to 3.0+ due to need of test
    flags support: haskell/cabal#5455

  * v1-copy was dropped, since it requires v1 build artifacts. There is
    no v2-copy command AFAICT.

  * I don't think there is an equivalent for the v1-install command for
    libraries?
  • Loading branch information
Rufflewind committed Sep 6, 2022
1 parent a965ac7 commit b6c591c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
include:
- { os: macos-latest, stack: lts-12.26, stack-extra-deps: "bytestring-0.11.3.0, filepath-1.4.100.0, unix-2.8.0.0" }
- { os: macos-latest, stack: lts-19.21, stack-extra-deps: "bytestring-0.11.3.0, filepath-1.4.100.0, unix-2.8.0.0" }
- { os: ubuntu-latest, ghc: 8.4.4, cabal: "2.4", overrides: "before_prepare() { sed -i.bak /utimensat/d configure.ac; }" }
- { os: ubuntu-latest, ghc: 8.4.4, cabal: 3.0.0.0, overrides: "before_prepare() { sed -i.bak /utimensat/d configure.ac; }" }
- { os: ubuntu-latest, ghc: 9.0.1, cabal: 3.4.0.0 }
- { os: ubuntu-latest, ghc: latest, cabal: latest }
- { os: windows-latest, stack: lts-12.26, stack-extra-deps: "bytestring-0.11.3.0, filepath-1.4.100.0, time-1.8.0.2, Win32-2.13.3.0", overrides: "before_prepare() { sed -i.bak -e /CreateSymbolicLinkW/d -e /GetFinalPathNameByHandleW/d configure.ac; }" }
Expand Down
9 changes: 3 additions & 6 deletions tools/testscript
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,22 @@ EOF
ghc --version
cabal --version
tools/retry cabal update
cabal v1-install --enable-tests --only-dependencies
cabal v2-configure -v2 --enable-tests --ghc-options="$ghcflags"

fi
}

build() {
if [ "${STACK_RESOLVER-}" ]; then
$stack test --haddock --no-haddock-deps \
$stack test --haddock --no-haddock-deps --keep-going \
--ghc-options "$ghcflags" \
--test-arguments "$testflags"
$stack sdist
else
testflags=`printf " %s" "$testflags" | sed "s/ / --test-option=/g"`
cabal v1-configure -v2 --enable-tests --ghc-options="$ghcflags"
cabal v1-build
cabal v1-test --show-details=streaming $testflags
cabal v2-test --keep-going --test-show-details=streaming $testflags
cabal check
cabal v2-sdist
cabal v1-copy
cabal v1-install --force-reinstalls --run-tests dist-newstyle/sdist/*-*.tar.gz
fi

Expand Down

0 comments on commit b6c591c

Please sign in to comment.