Blame telepathy-account-widgets/tools/test-wrapper.sh
|
Packit Service |
c6b9b0 |
#!/bin/sh
|
|
Packit Service |
c6b9b0 |
# Make tests shut up. On success, if stdout is a tty, we only output messages
|
|
Packit Service |
c6b9b0 |
# about skipped tests; on failure, or if stdout is a file or pipe, we output
|
|
Packit Service |
c6b9b0 |
# the lot.
|
|
Packit Service |
c6b9b0 |
#
|
|
Packit Service |
c6b9b0 |
# Usage: test-wrapper.sh PROGRAM [ARGS...]
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
set -e
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
if test -t 1 && test "z$CHECK_VERBOSE" = z; then
|
|
Packit Service |
c6b9b0 |
: # continue with the output-suppressed code path, below
|
|
Packit Service |
c6b9b0 |
else
|
|
Packit Service |
c6b9b0 |
"$@" || e=$?
|
|
Packit Service |
c6b9b0 |
exit $e
|
|
Packit Service |
c6b9b0 |
fi
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
e=0
|
|
Packit Service |
c6b9b0 |
"$@" > capture-$$.log 2>&1 || e=$?
|
|
Packit Service |
c6b9b0 |
if test z$e = z0; then
|
|
Packit Service |
c6b9b0 |
grep -i skipped capture-$$.log || true
|
|
Packit Service |
c6b9b0 |
rm -f capture-$$.log
|
|
Packit Service |
c6b9b0 |
else
|
|
Packit Service |
c6b9b0 |
cat capture-$$.log
|
|
Packit Service |
c6b9b0 |
exit $e
|
|
Packit Service |
c6b9b0 |
fi
|
|
Packit Service |
c6b9b0 |
|
|
Packit Service |
c6b9b0 |
# Copyright © 2010 Collabora Ltd. <http://www.collabora.co.uk/>
|
|
Packit Service |
c6b9b0 |
# Copying and distribution of this file, with or without modification,
|
|
Packit Service |
c6b9b0 |
# are permitted in any medium without royalty provided the copyright
|
|
Packit Service |
c6b9b0 |
# notice and this notice are preserved. There is no warranty.
|