]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AliGeant4/config/test_run.sh
added tcsh UI
[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="d"
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         if [ "$VER" = "d" ]; then
52           VER=0
53         else  
54           let VER=$VER+1
55         fi
56       done 
57       cd $TO
58     fi       
59   done
60 else
61
62 # loop over all structures
63   if [ "$DIR" = "STRUCT" ]; then
64     cd $TO/$DIR
65     for MODULE in `ls`; do
66       VER="d"
67       until [ "$VER" = "$MAX" ] ; do
68         if [ -f $MODULE/"v"$VER"_test"$GEN""$VIS".in" ]; then
69           echo "test_run_struct.sh $MODULE v$VER test$GEN$VIS"
70           test_run_struct.sh $MODULE -d $VER -g $GEN -v $VIS
71         fi  
72         if [ "$VER" = "d" ]; then
73           VER=0
74         else  
75           let VER=$VER+1
76         fi
77       done
78     done
79   else
80   
81 # run for specified detector only
82     if [ -d $DIR ] ; then
83       cd $TO/$DIR
84       VER=0
85       until [ "$VER" = "$MAX" ] ; do
86         if [ -f "v"$VER"_test"$GEN""$VIS".in" ] ; then
87           echo "test_run_in.sh $DIR v$VER test$GEN$VIS"
88           test_run_in.sh $DIR -d $VER -g $GEN -v $VIS
89         fi
90         let VER=$VER+1
91       done 
92       cd $TO
93     fi       
94   fi  
95 fi
96
97 cd $CURDIR