steps to support modern FreeBSD. After Robert Watson <rwatson@FreeBSD.org> and Alec...
[arla.git] / scripts / run-tests.sh
blob9d5d4742885360425bc3216f671d36c9bbd441df
1 #!/bin/sh
3 # $Id$
5 # This script will:
6 # - cd to the build directory and run the regression suite ther
7 # - build a summery of the test results
10 ppath=`dirname $0`
12 while test $# != 0; do
13 case $1
14 -no-start-arla) startarla=no ;;
15 -no-run-tests) runtests=no ;;
16 esac
17 shift;
18 done
20 test -f ${ppath}/test-config && . ${ppath}/test-config
22 if [ X$ADIR = X ]; then
23 ADIR=/nfsafs/e.kth.se/home/staff/lha/src/cvs/arla-0.35
26 USER="-user nobody"
28 eval `grep '^VERSION=' $ADIR/configure.in`
29 if [ X$VERSION = X ]; then
30 echo "Failed to find version of arla"
31 exit 1
34 WORKDIR=/afs/e.kth.se/home/staff/lha/TEST
36 export VERSION ADIR WORKDIR
38 OBJDIR=/usr/obj/arla-$VERSION
40 if [ ! -d $OBJDIR -o ! -d $OBJDIR/tests ] ; then
41 echo "Failed to find \$OBJDIR or \$OBJDIR/tests"
42 exit 1
45 cd $OBJDIR/tests
47 if [ ! -d /afs/stacken.kth.se ] ; then
48 echo "/afs already exists, refusing to start"
49 exit 1
52 if [ X$startarla != Xno ]; then
53 echo "Starting arla"
54 /usr/arla/sbin/startarla
56 sleep 10
58 else
59 echo "Not starting arla"
62 if [ ! -d /afs/stacken.kth.se ] ; then
63 echo "/afs does not exists, refusing to run tests"
64 exit 1
67 if [ X$runtests != Xno ] ; then
70 echo WORKDIR is $WORKDIR
71 echo WORKDIR is $WORKDIR >> rlog
73 echo "Running fast tests"
74 echo "Running fast tests" >> rlog
75 date >> rlog
76 ./run-tests $USER -all -fast >> rlog-fast 2>&1
77 echo "Running slow tests"
78 echo "Running slow tests" >> rlog
79 date >> rlog
80 ./run-tests $USER -all >> rlog-slow 2>&1
82 date >> rlog
85 echo Creating report
87 cat > rlog-report <<EOF
89 . Test report for arla-$VERSION
91 EOF
93 uname -a | sed 's/^/ /' >> rlog-report
95 echo " Summery created:" >> rlog-report
96 TZ=UTC date | sed 's/^/ /' >> rlog-report
98 cat >> rlog-report <<EOF
100 . Result times
104 cat rlog | sed 's/^/ /' >> rlog-report
106 cat >> rlog-report <<EOF
108 . Fast tests - summery
112 ${ppath}/extract-result.sh rlog-fast >> rlog-report
114 cat >> rlog-report <<EOF
116 . Fast tests - summery
120 ${ppath}/extract-result.sh rlog-slow >> rlog-report 2>&1
122 cat >> rlog-report <<EOF
124 . Report log
127 sed 's/^/ /' < rlog >> rlog-report
128 cat >> rlog-report <<EOF
130 . Complete tests below
132 + Fast tests
135 sed 's/^/ /' < rlog-fast >> rlog-report
136 cat >> rlog-report <<EOF
138 + Slow tests
141 sed 's/^/ /' < rlog-slow >> rlog-report
143 exit 0