Skip to content

Commit b01f808

Browse files
RyanGlScotthvr
authored andcommitted
Run tests on Travis (#24)
(except for GHC < 7.4)
1 parent b0f2bcf commit b01f808

File tree

2 files changed

+61
-41
lines changed

2 files changed

+61
-41
lines changed

.travis.yml

Lines changed: 59 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -13,67 +13,71 @@ before_cache:
1313

1414
matrix:
1515
include:
16-
- env: CABALVER=1.16 GHCVER=7.0.1
16+
- env: CABALVER=1.24 GHCVER=7.0.1
1717
compiler: ": #GHC 7.0.1"
18-
addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.1], sources: [hvr-ghc]}}
19-
- env: CABALVER=1.16 GHCVER=7.0.2
18+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.0.1], sources: [hvr-ghc]}}
19+
- env: CABALVER=1.24 GHCVER=7.0.2
2020
compiler: ": #GHC 7.0.2"
21-
addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.2], sources: [hvr-ghc]}}
22-
- env: CABALVER=1.16 GHCVER=7.0.3
21+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.0.2], sources: [hvr-ghc]}}
22+
- env: CABALVER=1.24 GHCVER=7.0.3
2323
compiler: ": #GHC 7.0.3"
24-
addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.3], sources: [hvr-ghc]}}
25-
- env: CABALVER=1.16 GHCVER=7.0.4
24+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.0.3], sources: [hvr-ghc]}}
25+
- env: CABALVER=1.24 GHCVER=7.0.4
2626
compiler: ": #GHC 7.0.4"
27-
addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4], sources: [hvr-ghc]}}
28-
- env: CABALVER=1.16 GHCVER=7.2.1
27+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.0.4], sources: [hvr-ghc]}}
28+
- env: CABALVER=1.24 GHCVER=7.2.1
2929
compiler: ": #GHC 7.2.1"
30-
addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.1], sources: [hvr-ghc]}}
31-
- env: CABALVER=1.16 GHCVER=7.2.2
30+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.2.1], sources: [hvr-ghc]}}
31+
- env: CABALVER=1.24 GHCVER=7.2.2
3232
compiler: ": #GHC 7.2.2"
33-
addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2], sources: [hvr-ghc]}}
34-
- env: CABALVER=1.16 GHCVER=7.4.1
33+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.2.2], sources: [hvr-ghc]}}
34+
- env: CABALVER=1.24 GHCVER=7.4.1
3535
compiler: ": #GHC 7.4.1"
36-
addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.1], sources: [hvr-ghc]}}
37-
- env: CABALVER=1.16 GHCVER=7.4.2
36+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.4.1], sources: [hvr-ghc]}}
37+
- env: CABALVER=1.24 GHCVER=7.4.2
3838
compiler: ": #GHC 7.4.2"
39-
addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2], sources: [hvr-ghc]}}
40-
- env: CABALVER=1.16 GHCVER=7.6.1
39+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.4.2], sources: [hvr-ghc]}}
40+
- env: CABALVER=1.24 GHCVER=7.6.1
4141
compiler: ": #GHC 7.6.1"
42-
addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.1], sources: [hvr-ghc]}}
43-
- env: CABALVER=1.16 GHCVER=7.6.2
42+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.6.1], sources: [hvr-ghc]}}
43+
- env: CABALVER=1.24 GHCVER=7.6.2
4444
compiler: ": #GHC 7.6.2"
45-
addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.2], sources: [hvr-ghc]}}
46-
- env: CABALVER=1.16 GHCVER=7.6.3
45+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.6.2], sources: [hvr-ghc]}}
46+
- env: CABALVER=1.24 GHCVER=7.6.3
4747
compiler: ": #GHC 7.6.3"
48-
addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3], sources: [hvr-ghc]}}
49-
- env: CABALVER=1.18 GHCVER=7.8.1
48+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.6.3], sources: [hvr-ghc]}}
49+
- env: CABALVER=1.24 GHCVER=7.8.1
5050
compiler: ": #GHC 7.8.1"
51-
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.1], sources: [hvr-ghc]}}
52-
- env: CABALVER=1.18 GHCVER=7.8.2
51+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.8.1], sources: [hvr-ghc]}}
52+
- env: CABALVER=1.24 GHCVER=7.8.2
5353
compiler: ": #GHC 7.8.2"
54-
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.2], sources: [hvr-ghc]}}
55-
- env: CABALVER=1.18 GHCVER=7.8.3
54+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.8.2], sources: [hvr-ghc]}}
55+
- env: CABALVER=1.24 GHCVER=7.8.3
5656
compiler: ": #GHC 7.8.3"
57-
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.3], sources: [hvr-ghc]}}
58-
- env: CABALVER=1.18 GHCVER=7.8.4
57+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.8.3], sources: [hvr-ghc]}}
58+
- env: CABALVER=1.24 GHCVER=7.8.4
5959
compiler: ": #GHC 7.8.4"
60-
addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4], sources: [hvr-ghc]}}
61-
- env: CABALVER=1.22 GHCVER=7.10.1
60+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.8.4], sources: [hvr-ghc]}}
61+
- env: CABALVER=1.24 GHCVER=7.10.1
6262
compiler: ": #GHC 7.10.1"
63-
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.1], sources: [hvr-ghc]}}
64-
- env: CABALVER=1.22 GHCVER=7.10.2
63+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.1], sources: [hvr-ghc]}}
64+
- env: CABALVER=1.24 GHCVER=7.10.2
6565
compiler: ": #GHC 7.10.2"
66-
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.2], sources: [hvr-ghc]}}
67-
- env: CABALVER=1.22 GHCVER=7.10.3
66+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.2], sources: [hvr-ghc]}}
67+
- env: CABALVER=1.24 GHCVER=7.10.3
6868
compiler: ": #GHC 7.10.3"
69-
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
69+
addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.3], sources: [hvr-ghc]}}
7070
- env: CABALVER=1.24 GHCVER=8.0.1
7171
compiler: ": #GHC 8.0.1"
7272
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1], sources: [hvr-ghc]}}
7373

7474
before_install:
7575
- unset CC
7676
- export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH
77+
- if [ "$GHCVER" != "7.2.1" ];
78+
then
79+
export TEST_OPTS="--enable-tests --enable-benchmarks";
80+
fi
7781

7882
install:
7983
- cabal --version
@@ -85,7 +89,13 @@ install:
8589
fi
8690
- travis_retry cabal update -v
8791
- sed -i 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
88-
- cabal install --only-dependencies --dry -v > installplan.txt
92+
# can't use "cabal install --only-dependencies --enable-tests" due to dep-cycle
93+
- if [ -n "$TEST_OPTS" ];
94+
then
95+
cabal install 'test-framework == 0.8.*' 'test-framework-hunit == 0.3.*' 'HUnit >= 1.2 && < 1.6' --dry -v > installplan.txt;
96+
else
97+
cabal install --only-dependencies --dry -v > installplan.txt;
98+
fi
8999
- sed -i -e '1,/^Resolving /d' installplan.txt; cat installplan.txt
90100

91101
# check whether current requested install-plan matches cached package-db snapshot
@@ -99,9 +109,14 @@ install:
99109
echo "cabal build-cache MISS";
100110
rm -rf $HOME/.cabsnap;
101111
mkdir -p $HOME/.ghc $HOME/.cabal/lib $HOME/.cabal/share $HOME/.cabal/bin;
102-
cabal install --only-dependencies;
112+
if [ -n "$TEST_OPTS" ];
113+
then
114+
cabal install -j 'test-framework == 0.8.*' 'test-framework-hunit == 0.3.*' 'HUnit >= 1.2 && < 1.6';
115+
else
116+
cabal install -j --only-dependencies;
117+
fi
103118
fi
104-
119+
105120
# snapshot package-db on cache miss
106121
- if [ ! -d $HOME/.cabsnap ];
107122
then
@@ -115,9 +130,13 @@ install:
115130
# any command which exits with a non-zero exit code causes the build to fail.
116131
script:
117132
- if [ -f configure.ac ]; then autoreconf -i; fi
118-
- cabal configure -v2 # -v2 provides useful information for debugging
133+
- cabal configure $TEST_OPTS -v2 # -v2 provides useful information for debugging
119134
- cabal build # this builds all libraries and executables (including tests/benchmarks)
120135
- cabal sdist # tests that a source-distribution can be generated
136+
- if [ -n "$TEST_OPTS" ];
137+
then
138+
cabal test --show-details=always;
139+
fi
121140

122141
# Check that the resulting source distribution can be built & installed.
123142
# If there are no other `.tar.gz` files in `dist`, this can be even simpler:

deepseq.cabal

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ test-suite deepseq-generics-tests
9090
build-depends:
9191
array,
9292
base,
93+
ghc-prim,
9394
-- end of packages with inherited version constraints
9495
test-framework == 0.8.*,
9596
test-framework-hunit == 0.3.*,
96-
HUnit >= 1.2 && < 1.4
97+
HUnit >= 1.2 && < 1.6

0 commit comments

Comments
 (0)