diff options
author | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-02-01 21:47:58 +0800 |
---|---|---|
committer | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-02-01 22:22:39 +0800 |
commit | 621bbbb8631f4b149d0478a3423687e4e973b04f (patch) | |
tree | 5dc21cc9d4893343c50af7e8f109905ac6ae447e /tools/test-wrapper.sh | |
parent | 9503c4aa28b9a4215e3e325a31b500f2c78b712a (diff) | |
download | gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar.gz gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar.bz2 gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar.lz gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar.xz gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.tar.zst gsoc2013-empathy-621bbbb8631f4b149d0478a3423687e4e973b04f.zip |
Update tools from telepathy-glib
Diffstat (limited to 'tools/test-wrapper.sh')
-rwxr-xr-x | tools/test-wrapper.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/test-wrapper.sh b/tools/test-wrapper.sh new file mode 100755 index 000000000..94900674a --- /dev/null +++ b/tools/test-wrapper.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Make tests shut up. On success, if stdout is a tty, we only output messages +# about skipped tests; on failure, or if stdout is a file or pipe, we output +# the lot. +# +# Usage: test-wrapper.sh PROGRAM [ARGS...] + +set -e + +if test -t 1 && test "z$CHECK_VERBOSE" = z; then + : # continue with the output-suppressed code path, below +else + "$@" || e=$? + exit $e +fi + +e=0 +"$@" > capture-$$.log 2>&1 || e=$? +if test z$e = z0; then + grep -i skipped capture-$$.log || true + rm -f capture-$$.log +else + cat capture-$$.log + exit $e +fi + +# Copyright © 2010 Collabora Ltd. <http://www.collabora.co.uk/> +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. There is no warranty. |