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="gross@esscc.uq.edu.au elspeth@esscc.uq.edu.au matt@esscc.uq.edu.au robert.woodcock@csiro.au Peter.Hornby@csiro.au" |
8 |
|
9 |
# the python tests to run |
10 |
BRUCE_PYTESTS="ImportTest.passed BruceTest.passed test_utilOnBruce.py" |
11 |
ESCRIPT_PYTESTS="ImportTest.passed BinaryOps.passed UnaryOps.passed SliceGetting.passed SliceSetting.passed MiscTests.passed ArchiveTests.passed newEscriptTests.passed test_xml.passed insituTests.passed s2.passed" |
12 |
FINLEY_PYTESTS="ImportTest.passed finleyTest.passed SimpleSolve.passed RecTest.passed test_linearPDEsOnFinley.passed test_generators.passed test_visualization_interface.passed test_utilOnFinley.passed" |
13 |
|
14 |
echo "===> cd $1" |
15 |
cd $1 |
16 |
if [ $? != 0 ] |
17 |
then |
18 |
echo "couldnt cd $1" |
19 |
echo "couldnt cd $1" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
20 |
exit 1 |
21 |
fi |
22 |
|
23 |
PWD=`pwd` |
24 |
echo "===> working in: $PWD" |
25 |
|
26 |
# Setup the environment |
27 |
. ${MODULESHOME}/init/sh |
28 |
module load intel_cc.9.0.026 |
29 |
export MODULEPATH=${MODULEPATH}:/data/raid2/toolspp4/modulefiles/gcc-3.3.6 |
30 |
module load boost/1.33.0/python-2.4.1 |
31 |
module load python/2.4.1 |
32 |
module load numarray/1.3.3 |
33 |
|
34 |
# set openmp settings |
35 |
export OMP_NUM_THREADS=4 |
36 |
|
37 |
echo "===> svn update" |
38 |
svn update |
39 |
if [ $? != 0 ] |
40 |
then |
41 |
echo "svn update failed" |
42 |
echo "svn update failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
43 |
exit 2 |
44 |
fi |
45 |
|
46 |
echo "===> scons building esys" |
47 |
scons |
48 |
if [ $? != 0 ] |
49 |
then |
50 |
echo "scons build failed" |
51 |
echo "scons build failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
52 |
exit 3 |
53 |
fi |
54 |
|
55 |
echo "===> building unit_tests" |
56 |
scons build_tests |
57 |
if [ $? != 0 ] |
58 |
then |
59 |
echo "unit_test build failed" |
60 |
echo "unit_test build failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
61 |
exit 3 |
62 |
fi |
63 |
|
64 |
FAIL=0 |
65 |
|
66 |
echo "===> running unit_tests" |
67 |
scons run_tests |
68 |
if [ $? != 0 ] |
69 |
then |
70 |
echo "unit_testing failed" |
71 |
echo "unit_test failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
72 |
FAIL=1 |
73 |
fi |
74 |
|
75 |
exit |
76 |
for pytest in $ESCRIPT_PYTESTS |
77 |
do |
78 |
echo "===>running escript python test: $pytest" |
79 |
scons build/posix/escript/test/python/$pytest |
80 |
if [ $? != 0 ] |
81 |
then |
82 |
echo "python testing failed for $pytest in module $module" |
83 |
echo "escript py_test: $pytest failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
84 |
FAIL=1 |
85 |
fi |
86 |
done |
87 |
|
88 |
for pytest in $FINLEY_PYTESTS |
89 |
do |
90 |
echo "running finley python test: $pytest" |
91 |
scons build/posix/finley/test/python/$pytest |
92 |
if [ $? != 0 ] |
93 |
then |
94 |
echo "python testing failed for $pytest in module $module" |
95 |
echo "finley py_test: $pytest failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
96 |
FAIL=1 |
97 |
fi |
98 |
done |
99 |
|
100 |
for pytest in $BRUCE_PYTESTS |
101 |
do |
102 |
echo "running bruce python test: $pytest" |
103 |
scons build/posix/bruce/test/python/$pytest |
104 |
if [ $? != 0 ] |
105 |
then |
106 |
echo "python testing failed for $pytest in module $module" |
107 |
echo "bruce py_test: $pytest failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
108 |
FAIL=1 |
109 |
fi |
110 |
done |
111 |
|
112 |
if [ $FAIL == 0 ] |
113 |
then |
114 |
echo success |
115 |
echo "success" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS |
116 |
fi |
117 |
exit 0 |