Commit ca6f056b authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Split up OS X tests to get them under the time.



Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent b4317657
......@@ -56,15 +56,22 @@ matrix:
# We axed GHC 7.6 and earlier because it's not worth the trouble to
# make older GHC work with clang's cpp. See
# https://ghc.haskell.org/trac/ghc/ticket/8493
- env: GHCVER=7.8.4 SCRIPT=script
- env: GHCVER=7.8.4 SCRIPT=script CABAL_LIB_ONLY=YES
os: osx
osx_image: xcode6.4 # We need 10.10
- env: GHCVER=7.8.4 SCRIPT=script CABAL_INSTALL_ONLY=YES
os: osx
osx_image: xcode6.4
# TODO: We might want to specify OSX version
# https://docs.travis-ci.com/user/osx-ci-environment/#OS-X-Version
- env: GHCVER=7.10.3 SCRIPT=script
- env: GHCVER=7.10.3 SCRIPT=script CABAL_LIB_ONLY=YES
os: osx
- env: GHCVER=7.10.3 SCRIPT=script CABAL_INSTALL_ONLY=YES
os: osx
- env: GHCVER=8.0.1 SCRIPT=script CABAL_LIB_ONLY=YES
os: osx
- env: GHCVER=8.0.1 SCRIPT=script
- env: GHCVER=8.0.1 SCRIPT=script CABAL_INSTALL_ONLY=YES
os: osx
- env: GHCVER=8.0.1 SCRIPT=bootstrap
os: osx
......
......@@ -44,7 +44,7 @@ cp cabal.project.travis cabal.project.local
# do it via new-build. See also cabal.project.travis. The downside of
# doing it this way is that the build product cannot be cached, but
# hackage-repo-tool is a relatively small package so it's good.
cabal unpack hackage-repo-tool-${HACKAGE_REPO_TOOL_VERSION}
timed cabal unpack hackage-repo-tool-${HACKAGE_REPO_TOOL_VERSION}
# ---------------------------------------------------------------------
# Cabal
......@@ -53,35 +53,39 @@ cabal unpack hackage-repo-tool-${HACKAGE_REPO_TOOL_VERSION}
# Needed to work around some bugs in nix-local-build code.
export CABAL_BUILDDIR="${CABAL_BDIR}"
# NB: Best to do everything for a single package together as it's
# more efficient (since new-build will uselessly try to rebuild
# Cabal otherwise).
if [ "x$PARSEC" = "xYES" ]; then
timed cabal new-build -fparsec Cabal Cabal:unit-tests Cabal:parser-tests Cabal:parser-hackage-tests
else
timed cabal new-build Cabal Cabal:unit-tests
fi
if [ "x$CABAL_INSTALL_ONLY" != "xYES" ] ; then
# We're doing a full build and test of Cabal
# NB: the '|| exit $?' workaround is required on old broken versions of bash
# that ship with OS X. See https://github.com/haskell/cabal/pull/3624 and
# http://stackoverflow.com/questions/14970663/why-doesnt-bash-flag-e-exit-when-a-subshell-fails
# NB: Best to do everything for a single package together as it's
# more efficient (since new-build will uselessly try to rebuild
# Cabal otherwise).
if [ "x$PARSEC" = "xYES" ]; then
timed cabal new-build -fparsec Cabal Cabal:unit-tests Cabal:parser-tests Cabal:parser-hackage-tests
else
timed cabal new-build Cabal Cabal:unit-tests
fi
# Run tests
(cd Cabal && timed ${CABAL_BDIR}/build/unit-tests/unit-tests $TEST_OPTIONS) || exit $?
# NB: the '|| exit $?' workaround is required on old broken versions of bash
# that ship with OS X. See https://github.com/haskell/cabal/pull/3624 and
# http://stackoverflow.com/questions/14970663/why-doesnt-bash-flag-e-exit-when-a-subshell-fails
if [ "x$PARSEC" = "xYES" ]; then
# Parser unit tests
(cd Cabal && timed ${CABAL_BDIR}/build/parser-tests/parser-tests $TEST_OPTIONS) || exit $?
# Run tests
(cd Cabal && timed ${CABAL_BDIR}/build/unit-tests/unit-tests $TEST_OPTIONS) || exit $?
# Test we can parse Hackage
(cd Cabal && timed ${CABAL_BDIR}/build/parser-tests/parser-hackage-tests $TEST_OPTIONS) | tail || exit $?
fi
if [ "x$PARSEC" = "xYES" ]; then
# Parser unit tests
(cd Cabal && timed ${CABAL_BDIR}/build/parser-tests/parser-tests $TEST_OPTIONS) || exit $?
# Run haddock
(cd Cabal && timed cabal act-as-setup --build-type=Simple -- haddock --builddir=${CABAL_BDIR}) || exit $?
# Test we can parse Hackage
(cd Cabal && timed ${CABAL_BDIR}/build/parser-tests/parser-hackage-tests $TEST_OPTIONS) | tail || exit $?
fi
# Check for package warnings
(cd Cabal && timed cabal check) || exit $?
# Run haddock
(cd Cabal && timed cabal act-as-setup --build-type=Simple -- haddock --builddir=${CABAL_BDIR}) || exit $?
# Check for package warnings
(cd Cabal && timed cabal check) || exit $?
fi
unset CABAL_BUILDDIR
......@@ -89,18 +93,24 @@ unset CABAL_BUILDDIR
export CABAL_BUILDDIR="${CABAL_TESTSUITE_BDIR}"
# NB: We always build this test runner, because it is used
# both by Cabal and cabal-install
timed cabal new-build cabal-testsuite:cabal-tests
(cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR}/build/cabal-tests/cabal-tests -j3 $TEST_OPTIONS) || exit $?
if [ "x$CABAL_INSTALL_ONLY" != "xYES" ] ; then
# We're doing a full build and test of Cabal
(cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR}/build/cabal-tests/cabal-tests -j3 $TEST_OPTIONS) || exit $?
# Redo the package tests with different versions of GHC
if [ "x$TEST_OTHER_VERSIONS" = "xYES" ]; then
(export CABAL_PACKAGETESTS_WITH_GHC="/opt/ghc/7.0.4/bin/ghc"; \
cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR}/build/cabal-tests/cabal-tests $TEST_OPTIONS)
(export CABAL_PACKAGETESTS_WITH_GHC="/opt/ghc/7.2.2/bin/ghc"; \
cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR}/build/cabal-tests/cabal-tests $TEST_OPTIONS)
(export CABAL_PACKAGETESTS_WITH_GHC="/opt/ghc/head/bin/ghc"; \
cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR}/build/cabal-tests/cabal-tests $TEST_OPTIONS)
# Redo the package tests with different versions of GHC
if [ "x$TEST_OTHER_VERSIONS" = "xYES" ]; then
(export CABAL_PACKAGETESTS_WITH_GHC="/opt/ghc/7.0.4/bin/ghc"; \
cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR}/build/cabal-tests/cabal-tests $TEST_OPTIONS)
(export CABAL_PACKAGETESTS_WITH_GHC="/opt/ghc/7.2.2/bin/ghc"; \
cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR}/build/cabal-tests/cabal-tests $TEST_OPTIONS)
(export CABAL_PACKAGETESTS_WITH_GHC="/opt/ghc/head/bin/ghc"; \
cd cabal-testsuite && timed ${CABAL_TESTSUITE_BDIR}/build/cabal-tests/cabal-tests $TEST_OPTIONS)
fi
fi
unset CABAL_BUILDDIR
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment