Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F8308972
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Subscribers
None
View Options
Index: trunk/test/test3
===================================================================
--- trunk/test/test3 (revision 67)
+++ trunk/test/test3 (revision 68)
@@ -1,26 +1,18 @@
#!/bin/bash
-# test for root
-which "root" &> /dev/null
-if [ $? -ne 0 ]
-then
- echo "ERROR: cannot run 'root'."
- exit 77
-fi
-
# run sampler
../bin/ElegentSDistributionSampler\
-pp -models "petrov (3p) [02]" -output "s-distribution_test.root"\
-N 100 -Wmin 2 -Wmax "1E5"\
|| exit 1
# check output
-root -b -q -l 'check_graph_points.cc("s-distribution_test.root", "petrov (3p) [02]/si_tot", 100)'
+$root_exe -b -q -l 'check_graph_points.cc("s-distribution_test.root", "petrov (3p) [02]/si_tot", 100)'
if [ $? -ne 0 ]
then
echo "ERROR: wrong number of points."
exit 2
fi
# succes
exit 0
Index: trunk/test/test4
===================================================================
--- trunk/test/test4 (revision 67)
+++ trunk/test/test4 (revision 68)
@@ -1,27 +1,20 @@
#!/bin/bash
-# test for root
-which "root" &> /dev/null
-if [ $? -ne 0 ]
-then
- echo "ERROR: cannot run 'root'."
- exit 77
-fi
-
+# input file present?
if [ ! -f "t-distribution_test.root" ]
then
echo "ERROR: cannot find file 't-distribution_test.root' - it should be produced by test1."
exit 77
fi
# run program
../bin/ElegentTest "t-distribution_test.root" "full range/petrov (3p) [02]/PH/cumulative cross-section" 0 10 3 &> "test4.out" \
|| exit 1
# test output
cat test4.out|grep "GenEvent: #0 ID=91" || exit 2
cat test4.out|grep "GenEvent: #1 ID=91" || exit 2
cat test4.out|grep "GenEvent: #2 ID=91" || exit 2
# succes
exit 0
Index: trunk/test/package_test
===================================================================
--- trunk/test/package_test (revision 67)
+++ trunk/test/package_test (revision 68)
@@ -1,31 +1,51 @@
#!/bin/bash
function RunTest()
{
echo ">> running test '$1'"
./$1 &> "$1.log"
code="$?"
case "$code" in
"0")
echo " PASS"
;;
"77")
echo " SKIPPED, details in '$1.log'"
;;
*)
echo " FAILED (code $code), details in '$1.log'"
;;
esac
}
#----------------------------------------------------------------------------------------------------
# set up environment
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/../lib
+#----------------------------------------------------------------------------------------------------
+
+# determine ROOT executable
+
+root_exe=`which "root"`
+if [ -z "$root_exe" ]
+then
+ root_exe=`which "root.exe"`
+fi
+
+if [ -z "$root_exe" ]
+then
+ echo "ERROR: Cannot determine ROOT executable. No tests will be run."
+ exit 1
+fi
+
+export root_exe=$root_exe
+
+#----------------------------------------------------------------------------------------------------
+
# run all tests
RunTest "test1"
RunTest "test2"
RunTest "test3"
RunTest "test4"
Index: trunk/test/test1
===================================================================
--- trunk/test/test1 (revision 67)
+++ trunk/test/test1 (revision 68)
@@ -1,28 +1,20 @@
#!/bin/bash
-# test for root
-which "root" &> /dev/null
-if [ $? -ne 0 ]
-then
- echo "ERROR: cannot run 'root'."
- exit 77
-fi
-
# run sampler
../bin/ElegentTDistributionSampler\
-energy 7000 -pp -models "petrov (3p) [02]" -output "t-distribution_test.root"\
-model-N 20 -model-tmax 20\
-full-N 10 -full-tmax 10\
-lowt-N 10 -lowt-tmax 1\
|| exit 1
# check output
-root -b -q -l 'check_graph_points.cc("t-distribution_test.root", "full range/petrov (3p) [02]/PH/amplitude_re", 10)'
+$root_exe -b -q -l 'check_graph_points.cc("t-distribution_test.root", "full range/petrov (3p) [02]/PH/amplitude_re", 10)'
if [ $? -ne 0 ]
then
echo "ERROR: wrong number of points."
exit 2
fi
# succes
exit 0
Index: trunk/test/test2
===================================================================
--- trunk/test/test2 (revision 67)
+++ trunk/test/test2 (revision 68)
@@ -1,26 +1,18 @@
#!/bin/bash
-# test for root
-which "root" &> /dev/null
-if [ $? -ne 0 ]
-then
- echo "ERROR: cannot run 'root'."
- exit 77
-fi
-
# run sampler
../bin/ElegentBDistributionSampler\
-energy 7000 -pp -models "petrov (3p) [02]" -output "b-distribution_test.root"\
-N 10 -bmin 0 -bmax 10\
|| exit 1
# check output
-root -b -q -l 'check_graph_points.cc("b-distribution_test.root", "petrov (3p) [02]/prf_re", 10)'
+$root_exe -b -q -l 'check_graph_points.cc("b-distribution_test.root", "petrov (3p) [02]/prf_re", 10)'
if [ $? -ne 0 ]
then
echo "ERROR: wrong number of points."
exit 2
fi
# succes
exit 0
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Dec 21, 1:47 PM (20 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4023017
Default Alt Text
(4 KB)
Attached To
rELEGENTSVN elegentsvn
Event Timeline
Log In to Comment