@@ -44,7 +44,7 @@ cp cabal.project.travis cabal.project.local
44
44
# do it via new-build. See also cabal.project.travis. The downside of
45
45
# doing it this way is that the build product cannot be cached, but
46
46
# hackage-repo-tool is a relatively small package so it's good.
47
- cabal unpack hackage-repo-tool-${HACKAGE_REPO_TOOL_VERSION}
47
+ timed cabal unpack hackage-repo-tool-${HACKAGE_REPO_TOOL_VERSION}
48
48
49
49
# ---------------------------------------------------------------------
50
50
# Cabal
@@ -53,54 +53,64 @@ cabal unpack hackage-repo-tool-${HACKAGE_REPO_TOOL_VERSION}
53
53
# Needed to work around some bugs in nix-local-build code.
54
54
export CABAL_BUILDDIR=" ${CABAL_BDIR} "
55
55
56
- # NB: Best to do everything for a single package together as it's
57
- # more efficient (since new-build will uselessly try to rebuild
58
- # Cabal otherwise).
59
- if [ " x$PARSEC " = " xYES" ]; then
60
- timed cabal new-build -fparsec Cabal Cabal:unit-tests Cabal:parser-tests Cabal:parser-hackage-tests
61
- else
62
- timed cabal new-build Cabal Cabal:unit-tests
63
- fi
56
+ if [ " x$CABAL_INSTALL_ONLY " != " xYES" ] ; then
57
+ # We're doing a full build and test of Cabal
64
58
65
- # NB: the '|| exit $?' workaround is required on old broken versions of bash
66
- # that ship with OS X. See https://github.com/haskell/cabal/pull/3624 and
67
- # http://stackoverflow.com/questions/14970663/why-doesnt-bash-flag-e-exit-when-a-subshell-fails
59
+ # NB: Best to do everything for a single package together as it's
60
+ # more efficient (since new-build will uselessly try to rebuild
61
+ # Cabal otherwise).
62
+ if [ " x$PARSEC " = " xYES" ]; then
63
+ timed cabal new-build -fparsec Cabal Cabal:unit-tests Cabal:parser-tests Cabal:parser-hackage-tests
64
+ else
65
+ timed cabal new-build Cabal Cabal:unit-tests
66
+ fi
68
67
69
- # Run tests
70
- (cd Cabal && timed ${CABAL_BDIR} /build/unit-tests/unit-tests $TEST_OPTIONS ) || exit $?
68
+ # NB: the '|| exit $?' workaround is required on old broken versions of bash
69
+ # that ship with OS X. See https://github.com/haskell/cabal/pull/3624 and
70
+ # http://stackoverflow.com/questions/14970663/why-doesnt-bash-flag-e-exit-when-a-subshell-fails
71
71
72
- if [ " x$PARSEC " = " xYES" ]; then
73
- # Parser unit tests
74
- (cd Cabal && timed ${CABAL_BDIR} /build/parser-tests/parser-tests $TEST_OPTIONS ) || exit $?
72
+ # Run tests
73
+ (cd Cabal && timed ${CABAL_BDIR} /build/unit-tests/unit-tests $TEST_OPTIONS ) || exit $?
75
74
76
- # Test we can parse Hackage
77
- (cd Cabal && timed ${CABAL_BDIR} /build/parser-tests/parser-hackage-tests $TEST_OPTIONS ) | tail || exit $?
78
- fi
75
+ if [ " x $PARSEC " = " xYES " ] ; then
76
+ # Parser unit tests
77
+ (cd Cabal && timed ${CABAL_BDIR} /build/parser-tests/parser-tests $TEST_OPTIONS ) || exit $?
79
78
80
- # Run haddock
81
- (cd Cabal && timed cabal act-as-setup --build-type=Simple -- haddock --builddir=${CABAL_BDIR} ) || exit $?
79
+ # Test we can parse Hackage
80
+ (cd Cabal && timed ${CABAL_BDIR} /build/parser-tests/parser-hackage-tests $TEST_OPTIONS ) | tail || exit $?
81
+ fi
82
82
83
- # Check for package warnings
84
- (cd Cabal && timed cabal check) || exit $?
83
+ # Run haddock
84
+ (cd Cabal && timed cabal act-as-setup --build-type=Simple -- haddock --builddir=${CABAL_BDIR} ) || exit $?
85
+
86
+ # Check for package warnings
87
+ (cd Cabal && timed cabal check) || exit $?
88
+ fi
85
89
86
90
unset CABAL_BUILDDIR
87
91
88
92
# Build and run the package tests
89
93
90
94
export CABAL_BUILDDIR=" ${CABAL_TESTSUITE_BDIR} "
91
95
96
+ # NB: We always build this test runner, because it is used
97
+ # both by Cabal and cabal-install
92
98
timed cabal new-build cabal-testsuite:cabal-tests
93
99
94
- (cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR} /build/cabal-tests/cabal-tests $TEST_OPTIONS ) || exit $?
100
+ if [ " x$CABAL_INSTALL_ONLY " != " xYES" ] ; then
101
+ # We're doing a full build and test of Cabal
102
+
103
+ (cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR} /build/cabal-tests/cabal-tests $TEST_OPTIONS ) || exit $?
95
104
96
- # Redo the package tests with different versions of GHC
97
- if [ " x$TEST_OTHER_VERSIONS " = " xYES" ]; then
98
- (export CABAL_PACKAGETESTS_WITH_GHC=" /opt/ghc/7.0.4/bin/ghc" ; \
99
- cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR} /build/cabal-tests/cabal-tests $TEST_OPTIONS )
100
- (export CABAL_PACKAGETESTS_WITH_GHC=" /opt/ghc/7.2.2/bin/ghc" ; \
101
- cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR} /build/cabal-tests/cabal-tests $TEST_OPTIONS )
102
- (export CABAL_PACKAGETESTS_WITH_GHC=" /opt/ghc/head/bin/ghc" ; \
103
- cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR} /build/cabal-tests/cabal-tests $TEST_OPTIONS )
105
+ # Redo the package tests with different versions of GHC
106
+ if [ " x$TEST_OTHER_VERSIONS " = " xYES" ]; then
107
+ (export CABAL_PACKAGETESTS_WITH_GHC=" /opt/ghc/7.0.4/bin/ghc" ; \
108
+ cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR} /build/cabal-tests/cabal-tests $TEST_OPTIONS )
109
+ (export CABAL_PACKAGETESTS_WITH_GHC=" /opt/ghc/7.2.2/bin/ghc" ; \
110
+ cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR} /build/cabal-tests/cabal-tests $TEST_OPTIONS )
111
+ (export CABAL_PACKAGETESTS_WITH_GHC=" /opt/ghc/head/bin/ghc" ; \
112
+ cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR} /build/cabal-tests/cabal-tests $TEST_OPTIONS )
113
+ fi
104
114
fi
105
115
106
116
unset CABAL_BUILDDIR
0 commit comments