#!/bin/bash # all - run all tests, in order # # test script files are named test01, test02, ...; temporary and output # files are named test01.xxx (etc.). On success, each test script # deletes its own temporary and output files. if ! test -x /usr/bin/tclsh then echo /usr/bin/tclsh not found -- sysadmin must install tcl echo numerous tests will fail without tcl installed fi # display g4bl and Geant4 versions echo help -exit help | g4bl - | egrep 'g4beamline ver|Geant4 ver' EXIT=0 NFAIL=0 NTOTAL=0 for i in test* do # skip files with a "." in their name if test "${i%.*}" != "$i"; then continue; fi # execute the test let NTOTAL=$NTOTAL+1 if ! ./$i; then EXIT=1; let NFAIL=$NFAIL+1; fi done if test "$EXIT" = "0" then echo "All Tests Passed" else echo "$NFAIL test(s) failed out of $NTOTAL total" fi exit $EXIT