| 1 | #!/bin/sh
|
|---|
| 2 | #
|
|---|
| 3 | # A simple script to run all the tests in this directory and check
|
|---|
| 4 | # their results against the expected (previous) results
|
|---|
| 5 | #
|
|---|
| 6 | # $Id: test.sh,v 1.9 2006/11/14 15:11:28 japost Exp $
|
|---|
| 7 | # $Name: geant4-09-02-cand-01 $
|
|---|
| 8 | #
|
|---|
| 9 |
|
|---|
| 10 | echo "Running on `hostname`, which is a `uname -a` machine"
|
|---|
| 11 | host=`hostname`
|
|---|
| 12 |
|
|---|
| 13 | target=testPropagateMagField
|
|---|
| 14 | echo "Compiling $target ... "
|
|---|
| 15 | gmake G4TARGET=$target || exit
|
|---|
| 16 | echo "Executing $target ..."
|
|---|
| 17 | for n in 1 2 3 4 5 6 7 8 9
|
|---|
| 18 | do
|
|---|
| 19 | echo "Executing with stepper choice $n .. \c"
|
|---|
| 20 | $G4WORKDIR/bin/$G4SYSTEM/$target $n > $target.newout$n \
|
|---|
| 21 | 2> $target.newerr$n
|
|---|
| 22 | echo ".. difference from expected output: "
|
|---|
| 23 | diff -wb $target.out$n $target.newout$n
|
|---|
| 24 | sleep 1;
|
|---|
| 25 | echo ".. difference from expected error: "
|
|---|
| 26 | diff -wb $target.err$n $target.newerr$n
|
|---|
| 27 | sleep 1;
|
|---|
| 28 | echo " "
|
|---|
| 29 | done
|
|---|
| 30 |
|
|---|
| 31 | target=testProElectroMagField
|
|---|
| 32 | echo "Compiling $target ... "
|
|---|
| 33 | gmake G4TARGET=$target || exit
|
|---|
| 34 | echo "Executing $target ..."
|
|---|
| 35 | for n in 1 2 3 4 8
|
|---|
| 36 | do
|
|---|
| 37 | echo "Executing with stepper choice $n .. \c"
|
|---|
| 38 | $G4WORKDIR/bin/$G4SYSTEM/$target $n > $target.newout$n \
|
|---|
| 39 | 2> $target.newerr$n
|
|---|
| 40 | echo ".. difference from expected output: "
|
|---|
| 41 | diff -wb $target.out$n $target.newout$n
|
|---|
| 42 | sleep 1;
|
|---|
| 43 | echo ".. difference from expected error: "
|
|---|
| 44 | diff -wb $target.err$n $target.newerr$n
|
|---|
| 45 | sleep 1;
|
|---|
| 46 | echo " "
|
|---|
| 47 | done
|
|---|
| 48 |
|
|---|
| 49 | for i in *Spin.cc
|
|---|
| 50 | do
|
|---|
| 51 | target=`basename $i .cc`
|
|---|
| 52 | echo "Compiling $target ... "
|
|---|
| 53 | gmake G4TARGET=$target || exit
|
|---|
| 54 | echo "Executing $target ..."
|
|---|
| 55 | for n in 4 3 2 1 0
|
|---|
| 56 | do
|
|---|
| 57 | echo "Executing with stepper choice $n .. \c"
|
|---|
| 58 | $G4WORKDIR/bin/$G4SYSTEM/$target $n > $target.newout$n \
|
|---|
| 59 | 2> $target.newerr$n
|
|---|
| 60 | echo ".. difference from expected output: "
|
|---|
| 61 | diff -wb $target.out$n $target.newout$n
|
|---|
| 62 | sleep 1;
|
|---|
| 63 | echo ".. difference from expected error: "
|
|---|
| 64 | diff -wb $target.err$n $target.newerr$n
|
|---|
| 65 | sleep 1;
|
|---|
| 66 | echo " "
|
|---|
| 67 | done
|
|---|
| 68 | done
|
|---|
| 69 |
|
|---|
| 70 | exit
|
|---|
| 71 |
|
|---|
| 72 | for i in *Spin.cc
|
|---|
| 73 | do
|
|---|
| 74 | target=`basename $i .cc`
|
|---|
| 75 | echo "Compiling $target ... "
|
|---|
| 76 | gmake G4TARGET=$target || exit
|
|---|
| 77 | echo "Executing $target ..."
|
|---|
| 78 | $G4WORKDIR/bin/$G4SYSTEM/$target > $target.newout \
|
|---|
| 79 | 2> $target.newerr
|
|---|
| 80 | echo ".. difference from expected output: "
|
|---|
| 81 | diff -wb $target.out $target.newout
|
|---|
| 82 | sleep 1;
|
|---|
| 83 | echo ".. difference from expected error: "
|
|---|
| 84 | diff -wb $target.err $target.newerr
|
|---|
| 85 | sleep 1;
|
|---|
| 86 | echo " "
|
|---|
| 87 | done
|
|---|
| 88 |
|
|---|
| 89 | exit
|
|---|