Forget all those old .a files, just make a big libwvstatic.a.
[wvstreams.git] / wvtesthelper
blob8c0359558f8678d2e2297960055665a62a65ed74
1 #!/bin/bash
3 # Try to run the given command in a pipe to the test meter, but if that
4 # fails, just dump it to stdout instead. Also make sure nobody *inside*
5 # us runs the testhelper script again.
7 export WVTESTRUN="env"
8 if [ -z "$WVSTREAMS_SRC" ]; then
9 WVSTREAMS_SRC="$(dirname $0)"
12 reportcode()
14 CODE=$1
15 if [ "$CODE" = "0" ]; then
16 echo "! wvtesthelper Test program exited ok ok"
17 else
18 echo "! wvtesthelper Test program aborted (code $CODE) FAILED"
20 return $CODE
23 exec 3>&1
25 if [ -z "$DISPLAY" ]; then
26 exec "$@"
27 else
28 WVTESTMETER=$WVSTREAMS_SRC/wvtestmeter
29 if [ ! -e $WVSTREAMS_SRC/wvtestmeter ]; then
30 WVTESTMETER=wvtestmeter
33 ( "$@"; reportcode $?) \
34 | tee /dev/fd/3 | ($WVTESTMETER || cat)
35 exit ${PIPESTATUS[0]}