summaryrefslogtreecommitdiff
path: root/Test/rtestall
blob: eecb5fda6318d4955c4d996264eede534b0ef144 (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
#!/usr/bin/bash

if [ "$1" == "short" ] ; then
  shift
  ALL_TESTS=`cat alltests.txt | grep -E "^[^[:space:]]+[[:space:]]+Use[[:space:]]" | awk '{print $1}'`
elif [ "$1" == "long" ] ; then
  shift
  ALL_TESTS=`cat alltests.txt | grep -E "^[^[:space:]]+[[:space:]]+Long[[:space:]]" | awk '{print $1}'`
else
  ALL_TESTS=`cat alltests.txt | grep -E "^[^[:space:]]+[[:space:]]+(Use|Long)[[:space:]]" | awk '{print $1}'`
fi

if [ "$1" == "time" ] ; then
  shift
  TIME_CMD="time -p"
else
  TIME_CMD=""
fi

if [ "$1" == "reverse" ] || [ "$1" == "rev" ]; then
  shift
  ALL_TESTS=`echo ${ALL_TESTS} | sed -e 's/ /\n/g' | awk '{a[NR] = $0} END { for(i=NR; i; --i) print a[i]}'`
fi

for t in ${ALL_TESTS} ; do
  # ${TIME_CMD} bash rtest $t "$@"
  if [ "${TIME_CMD}" == "" ] ; then
    ./runtest.bat $t "$@"
  else
    time -p ./runtest.bat $t "$@"
  fi
done