Skip to content

Commit

Permalink
Merge pull request haskell#3624 from phadej/osx-travis-wtf
Browse files Browse the repository at this point in the history
Test travis
  • Loading branch information
phadej authored Jul 27, 2016
2 parents 44f1617 + e49eb68 commit 5f29c68
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
12 changes: 6 additions & 6 deletions travis-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ timed cabal update
# issue, and it is easy enough to work around: clean first.

echo Cabal
(cd Cabal && timed cabal clean)
(cd Cabal && timed cabal sdist)
(cd Cabal && timed install_from_tarball)
(cd Cabal && timed cabal clean) || exit $?
(cd Cabal && timed cabal sdist) || exit $?
(cd Cabal && timed install_from_tarball) || exit $?

echo cabal-install
(cd cabal-install && timed cabal clean)
(cd cabal-install && timed cabal sdist)
(cd cabal-install && timed install_from_tarball)
(cd cabal-install && timed cabal clean) || exit $?
(cd cabal-install && timed cabal sdist) || exit $?
(cd cabal-install && timed install_from_tarball) || exit $?
2 changes: 1 addition & 1 deletion travis-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CABAL_VERSION="1.25.0.0"
timed() {
echo "\$ $*"
start_time=$(date +%s)
$*
$* || exit $?
end_time=$(date +%s)
duration=$((end_time - start_time))
echo "$* took $duration seconds."
Expand Down
4 changes: 2 additions & 2 deletions travis-meta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
#./Cabal/misc/gen-authors.sh > AUTHORS

# Regenerate the 'extra-source-files' field in Cabal.cabal.
(cd Cabal && timed ./misc/gen-extra-source-files.sh Cabal.cabal)
(cd Cabal && timed ./misc/gen-extra-source-files.sh Cabal.cabal) || exit $?

# Regenerate the 'extra-source-files' field in cabal-install.cabal.
(cd cabal-install && ../Cabal/misc/gen-extra-source-files.sh cabal-install.cabal)
(cd cabal-install && ../Cabal/misc/gen-extra-source-files.sh cabal-install.cabal) || exit $?

# Fail if the diff is not empty.
timed ./Cabal/misc/travis-diff-files.sh
27 changes: 15 additions & 12 deletions travis-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,15 @@ export CABAL_BUILDDIR="${CABAL_BDIR}"
# Cabal otherwise).
timed cabal new-build Cabal Cabal:package-tests Cabal:unit-tests

# Note: http://stackoverflow.com/questions/14970663/why-doesnt-bash-flag-e-exit-when-a-subshell-fails
# some osx has broken bash

# Run tests
(cd Cabal && timed ${CABAL_BDIR}/build/package-tests/package-tests $TEST_OPTIONS)
(cd Cabal && timed ${CABAL_BDIR}/build/unit-tests/unit-tests $TEST_OPTIONS)
(cd Cabal && timed ${CABAL_BDIR}/build/package-tests/package-tests $TEST_OPTIONS) || exit $?
(cd Cabal && timed ${CABAL_BDIR}/build/unit-tests/unit-tests $TEST_OPTIONS) || exit $?

# Run haddock (hack: use the Setup script from package-tests!)
(cd Cabal && timed cabal act-as-setup --build-type=Simple -- haddock --builddir=${CABAL_BDIR})
(cd Cabal && timed cabal act-as-setup --build-type=Simple -- haddock --builddir=${CABAL_BDIR}) || exit $?

# Redo the package tests with different versions of GHC
# TODO: reenable me
Expand All @@ -64,10 +67,10 @@ timed cabal new-build Cabal Cabal:package-tests Cabal:unit-tests
# fi

# Check for package warnings
(cd Cabal && timed cabal check)
(cd Cabal && timed cabal check) || exit $?

# Test that an sdist can be created
(cd Cabal && timed cabal sdist --builddir=${CABAL_BDIR})
(cd Cabal && timed cabal sdist --builddir=${CABAL_BDIR}) || exit $?

unset CABAL_BUILDDIR

Expand All @@ -85,16 +88,16 @@ timed cabal new-build cabal-install:cabal \
cabal-install:solver-quickcheck

# Run tests
(cd cabal-install && timed ${CABAL_INSTALL_BDIR}/build/unit-tests/unit-tests $TEST_OPTIONS)
(cd cabal-install && timed ${CABAL_INSTALL_BDIR}/build/solver-quickcheck/solver-quickcheck $TEST_OPTIONS --quickcheck-tests=1000)
(cd cabal-install && timed ${CABAL_INSTALL_BDIR}/build/integration-tests/integration-tests $TEST_OPTIONS)
(cd cabal-install && timed ${CABAL_INSTALL_BDIR}/build/integration-tests2/integration-tests2 $TEST_OPTIONS)
(cd cabal-install && timed ${CABAL_INSTALL_BDIR}/build/unit-tests/unit-tests $TEST_OPTIONS) || exit $?
(cd cabal-install && timed ${CABAL_INSTALL_BDIR}/build/solver-quickcheck/solver-quickcheck $TEST_OPTIONS --quickcheck-tests=1000) || exit $?
(cd cabal-install && timed ${CABAL_INSTALL_BDIR}/build/integration-tests/integration-tests $TEST_OPTIONS) || exit $?
(cd cabal-install && timed ${CABAL_INSTALL_BDIR}/build/integration-tests2/integration-tests2 $TEST_OPTIONS) || exit $?

# Haddock
(cd cabal-install && timed ${CABAL_INSTALL_SETUP} haddock --builddir=${CABAL_INSTALL_BDIR} )
(cd cabal-install && timed ${CABAL_INSTALL_SETUP} haddock --builddir=${CABAL_INSTALL_BDIR} ) || exit $?

(cd cabal-install && timed cabal check)
(cd cabal-install && timed cabal sdist --builddir=${CABAL_INSTALL_BDIR})
(cd cabal-install && timed cabal check) || exit $?
(cd cabal-install && timed cabal sdist --builddir=${CABAL_INSTALL_BDIR}) || exit $?

unset CABAL_BUILDDIR

Expand Down

0 comments on commit 5f29c68

Please sign in to comment.