File: test-wrapper.sh

package info (click to toggle)
telepathy-logger 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 3,980 kB
  • ctags: 2,061
  • sloc: ansic: 15,979; sh: 11,318; python: 2,960; makefile: 629; xml: 185
file content (30 lines) | stat: -rwxr-xr-x 807 bytes parent folder | download | duplicates (28)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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.