summaryrefslogtreecommitdiffstats
path: root/runtest.sh
blob: 14bd87c6d4be28de0062afcb3f0bd37dc4fa8fda (plain)
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
31
32
33
34
35
36
37
#! /bin/sh

# Collect stdout/stderr someplace else

if [ ! -d testsuite ]; then
  mkdir -p testsuite
fi

SRCDIR=`dirname $0`
export SRCDIR

SYSTEMTAP_TAPSET=$SRCDIR/tapset
export SYSTEMTAP_TAPSET

SYSTEMTAP_RUNTIME=$SRCDIR/runtime
export SYSTEMTAP_RUNTIME

dn=`dirname $1`
logfile=testsuite/`basename $dn`-`basename $1`

env | grep SYSTEMTAP > $logfile.cmd
echo "$@" >> $logfile.cmd
eval $@ >$logfile.out 2>$logfile.err
rc=$?
echo "rc=$rc" > $logfile.rc

if expr $1 : '.*ok/.*' >/dev/null; then
  if [ $rc -eq 0 ]; then
     rm -f $logfile.*
  fi
else
  if [ $rc -eq 1 ]; then
     rm -f $logfile.*
  fi
fi

exit $rc