summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2016-11-28 13:04:13 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2016-11-29 12:36:41 +0000
commit854ef13dfb9c45fd7b026c8156ac43d2d0056717 (patch)
tree4af175779bf7b29e4a3d442c627d27858ac61ebc
parent8dc928d5ea364e2f12ecb6a1165eba60e9784392 (diff)
downloaddbus-854ef13dfb9c45fd7b026c8156ac43d2d0056717.tar.gz
travis-ci: introduce maybe_fail_tests() to make test failure more obvious
Taken from the version I added to OSTree. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98889
-rwxr-xr-xtools/ci-build.sh19
1 files changed, 12 insertions, 7 deletions
diff --git a/tools/ci-build.sh b/tools/ci-build.sh
index d85b28f0..c3b4f498 100755
--- a/tools/ci-build.sh
+++ b/tools/ci-build.sh
@@ -34,6 +34,12 @@ NULL=
: "${ci_test_fatal:=yes}"
: "${ci_variant:=production}"
+maybe_fail_tests () {
+ if [ "$ci_test_fatal" = yes ]; then
+ exit 1
+ fi
+}
+
NOCONFIGURE=1 ./autogen.sh
srcdir="$(pwd)"
@@ -157,10 +163,9 @@ case "$ci_buildsys" in
"$@"
${make}
- [ "$ci_test" = no ] || ${make} check || [ "$ci_test_fatal" = no ]
+ [ "$ci_test" = no ] || ${make} check || maybe_fail_tests
cat test/test-suite.log || :
- [ "$ci_test" = no ] || ${make} distcheck || \
- [ "$ci_test_fatal" = no ]
+ [ "$ci_test" = no ] || ${make} distcheck || maybe_fail_tests
${make} install DESTDIR=$(pwd)/DESTDIR
( cd DESTDIR && find . )
@@ -168,19 +173,19 @@ case "$ci_buildsys" in
if [ "$ci_sudo" = yes ] && [ "$ci_test" = yes ]; then
sudo ${make} install
LD_LIBRARY_PATH=/usr/local/lib ${make} installcheck || \
- [ "$ci_test_fatal" = no ]
+ maybe_fail_tests
cat test/test-suite.log || :
# re-run them with gnome-desktop-testing
env LD_LIBRARY_PATH=/usr/local/lib \
gnome-desktop-testing-runner -d /usr/local/share dbus/ || \
- [ "$ci_test_fatal" = no ]
+ maybe_fail_tests
# these tests benefit from being re-run as root
sudo env LD_LIBRARY_PATH=/usr/local/lib \
gnome-desktop-testing-runner -d /usr/local/share \
dbus/test-uid-permissions_with_config.test || \
- [ "$ci_test_fatal" = no ]
+ maybe_fail_tests
fi
;;
@@ -209,7 +214,7 @@ case "$ci_buildsys" in
# The test coverage for OOM-safety is too verbose to be useful on
# travis-ci.
export DBUS_TEST_MALLOC_FAILURES=0
- [ "$ci_test" = no ] || ctest -VV || [ "$ci_test_fatal" = no ]
+ [ "$ci_test" = no ] || ctest -VV || maybe_fail_tests
${make} install DESTDIR=$(pwd)/DESTDIR
( cd DESTDIR && find . )
;;