]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AliGeant4/config/test_run.sh
This commit was generated by cvs2svn to compensate for changes in r1459,
[u/mrichter/AliRoot.git] / AliGeant4 / config / test_run.sh
1 # $Id$
2 # ----------------------------------------------------------------
3 # This script runs specified (or default) test macros 
4 # for all versions of one detector if it specified 
5 # or for all detectors otherwise
6 #
7 # Usage: test_run.sh detName [-g genNumber] [-v visNumber]
8 #                      for all detectors: detName = ALL
9 #
10 # 5.11.99  I. Hrivnacova
11
12 # check input parameters
13 if [ $# -lt 1 ]; then
14   echo "Usage: "
15   echo "test_run.sh detName [-g genNumber] [-v visNumber]"
16   echo "               for all detectors: detName = ALL"
17   exit
18 fi
19
20 # default parameters
21 DIR=$1
22 GEN="0"
23 VIS="0"
24
25 # get input parameters
26 for param in $*
27 do
28   case $param in
29     -g) GEN=$3; shift 2;;
30     -v) VIS=$3; shift 2;;
31   esac
32 done
33
34 CURDIR=`pwd`
35 SRC=$ALICE_ROOT
36 TO=$AG4_INSTALL/"test"
37 MAX=10
38
39 cd $TO
40 if [ "$DIR" = "ALL" ]; then
41 # loop over all detectors if det is not specified
42   for DIR in `ls`; do
43     if [ -d $DIR ] ; then
44       cd $TO/$DIR
45       VER=0
46       until [ "$VER" = "$MAX" ] ; do
47         if [ -f "v"$VER"_test"$GEN""$VIS".in" ] ; then
48           echo "test_run_in.sh $DIR v$VER test$GEN$VIS"
49           test_run_in.sh $DIR -d $VER -g $GEN -v $VIS
50         fi
51         let VER=$VER+1
52       done 
53       cd $TO
54     fi       
55   done
56 else
57
58 # loop over all structures
59   if [ "$DIR" = "STRUCT" ]; then
60     cd $TO/$DIR
61     for MODULE in `ls`; do
62       VER=0
63       until [ "$VER" = "$MAX" ] ; do
64         if [ -f $MODULE/"v"$VER"_test"$GEN""$VIS".in" ]; then
65           echo "test_run_struct.sh $MODULE v$VER test$GEN$VIS"
66           test_run_struct.sh $MODULE -d $VER -g $GEN -v $VIS
67         fi  
68         let VER=$VER+1
69       done
70     done
71   else
72   
73 # run for specified detector only
74     if [ -d $DIR ] ; then
75       cd $TO/$DIR
76       VER=0
77       until [ "$VER" = "$MAX" ] ; do
78         if [ -f "v"$VER"_test"$GEN""$VIS".in" ] ; then
79           echo "test_run_in.sh $DIR v$VER test$GEN$VIS"
80           test_run_in.sh $DIR -d $VER -g $GEN -v $VIS
81         fi
82         let VER=$VER+1
83       done 
84       cd $TO
85     fi       
86   fi  
87 fi
88
89 cd $CURDIR