build: remove -enumtypes rules
[empathy-mirror.git] / tools / test-wrapper.sh
blob94900674a80f3ddb64db9c0610737afba6cf52ca
1 #!/bin/sh
2 # Make tests shut up. On success, if stdout is a tty, we only output messages
3 # about skipped tests; on failure, or if stdout is a file or pipe, we output
4 # the lot.
6 # Usage: test-wrapper.sh PROGRAM [ARGS...]
8 set -e
10 if test -t 1 && test "z$CHECK_VERBOSE" = z; then
11 : # continue with the output-suppressed code path, below
12 else
13 "$@" || e=$?
14 exit $e
17 e=0
18 "$@" > capture-$$.log 2>&1 || e=$?
19 if test z$e = z0; then
20 grep -i skipped capture-$$.log || true
21 rm -f capture-$$.log
22 else
23 cat capture-$$.log
24 exit $e
27 # Copyright © 2010 Collabora Ltd. <http://www.collabora.co.uk/>
28 # Copying and distribution of this file, with or without modification,
29 # are permitted in any medium without royalty provided the copyright
30 # notice and this notice are preserved. There is no warranty.