|
3 | 3 | # coatjava must already be built at ../../coatjava/ |
4 | 4 |
|
5 | 5 | # set up environment |
| 6 | +JAVA_OPTS="-Djava.util.logging.config.file=$PWD/../../etc/logging/debug.properties" |
6 | 7 | CLARA_HOME=$PWD/clara_installation/ ; export CLARA_HOME |
7 | 8 | COAT=$CLARA_HOME/plugins/clas12/ |
8 | 9 | classPath="$COAT/lib/services/*:$COAT/lib/clas/*:$COAT/lib/utils/*:../lib/*:src/" |
9 | 10 |
|
10 | 11 | # install clara |
11 | 12 | ../../install-clara -c ../../coatjava $CLARA_HOME |
12 | | -if [ $? != 0 ] ; then echo "clara installation error" ; exit 1 ; fi |
| 13 | +[ $? -ne 0 ] && echo "clara installation error" && exit 1 |
13 | 14 |
|
14 | 15 | # download test files |
15 | 16 | wget --no-check-certificate http://clasweb.jlab.org/clas12offline/distribution/coatjava/validation_files/twoTrackEvents_809_raw.evio.tar.gz |
16 | | - |
17 | | -if [ $? != 0 ] ; then echo "wget validation files failure" ; exit 1 ; fi |
| 17 | +[ $? -ne 0 ] && echo "wget validation files failure" && exit 2 |
18 | 18 | tar -zxvf twoTrackEvents_809_raw.evio.tar.gz |
19 | 19 |
|
20 | | -export JAVA_OPTS="-Djava.util.logging.config.file=$PWD/../../etc/logging/debug.properties" |
21 | | - |
22 | 20 | # run decoder |
23 | 21 | $COAT/bin/decoder -t -0.5 -s 0.0 -i ./twoTrackEvents_809_raw.evio -o ./twoTrackEvents_809.hipo -c 2 |
| 22 | +[ $? -ne 0 ] && echo "decoder failure" && exit 3 |
24 | 23 |
|
25 | 24 | # run clara |
26 | | -$COAT/bin/run-clara $COAT/etc/services/kpp.yaml || echo "reconstruction with clara failure" && exit 1 |
| 25 | +$COAT/bin/run-clara $COAT/etc/services/kpp.yaml |
| 26 | +[ $? -ne 0 ] && echo "reconstruction with clara failure" && exit 4 |
27 | 27 |
|
28 | 28 | # compile test codes |
29 | 29 | javac -cp $classPath src/kpptracking/KppTrackingTest.java |
30 | | -if [ $? != 0 ] ; then echo "KppTrackingTest compilation failure" ; exit 1 ; fi |
| 30 | +[ $? -ne 0 ] && echo "KppTrackingTest compilation failure" && exit 5 |
31 | 31 |
|
32 | 32 | # run KppTracking junit tests |
33 | 33 | java -DCLAS12DIR="$COAT" -Xmx1536m -Xms1024m -cp $classPath org.junit.runner.JUnitCore kpptracking.KppTrackingTest |
34 | | -if [ $? != 0 ] ; then echo "KppTracking unit test failure" ; exit 1 ; else echo "KppTracking passed unit tests" ; fi |
| 34 | +[ $? -ne 0 ] && echo "KppTracking unit test failure" && exit 6 |
| 35 | + |
| 36 | +echo "KppTracking passed unit tests" |
0 commit comments