1 |
#!/bin/bash |
2 |
|
3 |
# $Id: autotest-scons 162 2005-11-11 00:09:59Z svn $ |
4 |
# An explicit testing script for esys using the scons build system |
5 |
|
6 |
# list of users to email test results to |
7 |
MAIL_RECIPIENTS="jgs@esscc.uq.edu.au gross@esscc.uq.edu.au cochrane@esscc.uq.edu.au elspeth@esscc.uq.edu.au matt@esscc.uq.edu.au" |
8 |
#MAIL_RECIPIENTS="jgs@esscc.uq.edu.au" |
9 |
|
10 |
# modules to test |
11 |
TESTS="escript bruce finley" |
12 |
|
13 |
# the python tests to run |
14 |
FINLEY_PYTESTS="ImportTest.py finleyTest.py SimpleSolve.py GradTest.py RecTest.py test_linearPDEsOnFinley.py test_generators.py test_visualization_interface.py test_utilOnFinley.py test_symbolsOnFinley.py" |
15 |
ESCRIPT_PYTESTS="ImportTest.py BinaryOps.py UnaryOps.py SliceGetting.py SliceSetting.py MiscTests.py ArchiveTests.py escriptTest.py newEscriptTests.py DataVariableTests.py test_xml.py" |
16 |
BRUCE_PYTESTS="ImportTest.py BruceTest.py test_utilOnBruce.py test_symbolsOnBruce.py" |
17 |
|
18 |
echo cd $1 |
19 |
cd $1 |
20 |
if [ $? != 0 ] |
21 |
then |
22 |
echo couldnt cd $1 |
23 |
echo "couldnt cd $1" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
24 |
exit 1 |
25 |
fi |
26 |
|
27 |
PWD=`pwd` |
28 |
echo working in: $PWD |
29 |
|
30 |
# define compiler executable and library locations |
31 |
export PATH=/opt/intel/cmplrs/80.058/intel_cc_80/bin:$PATH |
32 |
export LD_LIBRARY_PATH=/opt/intel/cmplrs/80.058/intel_cc_80/lib |
33 |
|
34 |
# define python location |
35 |
export PATH=/raid2/tools/python-2.3.4/bin:$PATH |
36 |
|
37 |
# set library and openmp settings |
38 |
export LD_LIBRARY_PATH=$PWD/lib:/raid2/tools/boost/lib:$LD_LIBRARY_PATH |
39 |
export PYTHONPATH=$PWD |
40 |
export OMP_SCHEDULE="dynamic" |
41 |
export OMP_NUM_THREADS=4 |
42 |
export OMP_DYNAMIC=TRUE |
43 |
export OMP_NESTED=FALSE |
44 |
|
45 |
FAIL=0 |
46 |
|
47 |
echo svn update |
48 |
svn update |
49 |
if [ $? != 0 ] |
50 |
then |
51 |
echo svn update failed |
52 |
echo "svn update failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
53 |
exit 2 |
54 |
fi |
55 |
|
56 |
echo building scons debug=1 |
57 |
scons debug=1 |
58 |
if [ $? != 0 ] |
59 |
then |
60 |
echo scons build failed |
61 |
echo "scons build failed - see autotest-scons logfile" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
62 |
exit 3 |
63 |
fi |
64 |
|
65 |
echo building unit_tests |
66 |
scons debug=1 build_tests |
67 |
if [ $? != 0 ] |
68 |
then |
69 |
echo unit_test build failed |
70 |
echo "unit_test build failed - see autotest-scons logfile" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
71 |
exit 3 |
72 |
fi |
73 |
|
74 |
echo running unit_tests |
75 |
scons debug=1 run_tests |
76 |
if [ $? != 0 ] |
77 |
then |
78 |
echo unit_testing failed |
79 |
echo "unit_test failed - see autotest-scons logfile" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
80 |
FAIL=1 |
81 |
fi |
82 |
|
83 |
for module in $TESTS |
84 |
do |
85 |
echo "running python tests for: $module" |
86 |
cd $module/test/python |
87 |
if [ "$module" == "finley" ] |
88 |
then |
89 |
for pytest in $FINLEY_PYTESTS |
90 |
do |
91 |
echo "Running python test: $pytest" |
92 |
python $pytest |
93 |
if [ $? != 0 ] |
94 |
then |
95 |
echo Python Testing FAILED for $pytest in module $module |
96 |
echo "finley py_test: $pytest failed - see autotest-scons logfile" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
97 |
FAIL=1 |
98 |
fi |
99 |
done |
100 |
elif [ "$module" == "escript" ] |
101 |
then |
102 |
for pytest in $ESCRIPT_PYTESTS |
103 |
do |
104 |
echo "Running python test: $pytest" |
105 |
python $pytest |
106 |
if [ $? != 0 ] |
107 |
then |
108 |
echo Python Testing FAILED for $pytest in module $module |
109 |
echo "escript py_test: $pytest failed - see autotest-scons logfile" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
110 |
FAIL=1 |
111 |
fi |
112 |
done |
113 |
elif [ "$module" == "bruce" ] |
114 |
then |
115 |
for pytest in $BRUCE_PYTESTS |
116 |
do |
117 |
echo "Running python test: $pytest" |
118 |
python $pytest |
119 |
if [ $? != 0 ] |
120 |
then |
121 |
echo Python Testing FAILED for $pytest in module $module |
122 |
echo "bruce py_test: $pytest failed - see autotest-scons logfile" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
123 |
FAIL=1 |
124 |
fi |
125 |
done |
126 |
fi |
127 |
cd ../../.. |
128 |
done |
129 |
|
130 |
if [ $FAIL == 0 ] |
131 |
then |
132 |
echo success |
133 |
echo "success" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
134 |
fi |
135 |
exit 0 |