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