-
Notifications
You must be signed in to change notification settings - Fork 2
/
run-test.sh
executable file
·39 lines (30 loc) · 1.12 KB
/
run-test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
set -ue
compiler_versions="9.0 9.2 9.4 9.6"
for v in $compiler_versions; do
ghc_exact_ver=$(ghcup run --ghc $v -- ghc --numeric-version)
cabal="ghcup run --ghc $ghc_exact_ver --cabal latest -- cabal --config-file=$HOME/.cabal/config_nohaddock"
echo == ghc-${ghc_exact_ver} ==
echo Build the library
build_opt="-v0 -j4"
test_opt="--test-show-details=failures"
$cabal v2-build \
--write-ghc-environment-files=always \
--enable-tests $build_opt \
matchable matchable-th
echo Build examples
$cabal v2-build $build_opt \
matchable-examples
echo Run tests
$cabal v2-test $build_opt $test_opt \
matchable:matchable-test\
matchable-th:matchable-th-test
echo Install doctest for the current compiler
doctest_dir="./doctest-bin/ghc-${ghc_exact_ver}"
mkdir -p "$doctest_dir"
$cabal v2-install -v0 $build_opt \
"--installdir=$doctest_dir" --overwrite-policy=always \
doctest --allow-newer
echo Run doctest
$cabal v2-repl -v0 "--with-ghc=$doctest_dir/doctest"
done