/[escript]/trunk/autotest-scons
ViewVC logotype

Diff of /trunk/autotest-scons

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 356 by jgs, Wed Dec 14 05:37:24 2005 UTC revision 2368 by gross, Mon Apr 6 05:05:35 2009 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2    
3  # $Id: autotest-scons 162 2005-11-11 00:09:59Z svn $  # The test suite no longer runs as a PBS job (can't compile jobs on a
4  # An explicit testing script for esys using the scons build system  # compute node because the compilers are on local disk of the login node)
5    
6    MAIL_RECIPIENTS="l.gross@uq.edu.au Peter.Hornby@csiro.au k.steube@uq.edu.au artak@uq.edu.au c.altinay@uq.edu.au j.fenwick1@uq.edu.au"
7    # MAIL_RECIPIENTS="k.steube@uq.edu.au"
8    
9    NCPUS=4
10    TEST_DIR=/data1/ksteube/EscriptDev/AutoTests
11    TEST_NAME='all_tests'
12    
13    RunDate=`date '+%Y_%m_%d'`  # Time stamp for log file names
14    
15    START=`date '+%Y/%m/%d %H:%M'`
16    
17    SCRIPT_NAME=$0
18    
19    finish () {
20      # state will be 'FAILURE' or 'SUCCESS'
21      state="$1"
22      message="$2"
23      date
24      # Clean up the sandbox
25      cd $TEST_DIR
26      /bin/rm -rf sandbox.$RunDate
27      END=`date '+%Y/%m/%d %H:%M'`
28      cat << END_MSG | mail -s "ESYS_TESTS $TEST_NAME $RunDate $state" $MAIL_RECIPIENTS
29    $message.
30    The tests ran from $START to $END on $NCPUS cores
31    See the log files in $TEST_DIR/Logs/$RunDate*
32    This mail was sent by $SCRIPT_NAME
33    running as $USER on `hostname`.
34    END_MSG
35      # There are three ways to see errors:
36      # egrep 'FAIL|Error:|error set =' $TEST_DIR/Logs/$RunDate.test.output
37      if [ "x$state" = "xFAILURE" ]; then
38        touch Logs/$RunDate.FAILURE
39        exit 1
40      fi
41      exit 0
42    }
43    
44    
45    cat /dev/null > $TEST_DIR/Logs/$RunDate.test.output \
46                        || finish FAILURE "Could not create out_file $TEST_DIR/Logs/$RunDate.test.output"
47    
48    # Save output in Logs/date.test.output
49    exec 1> $TEST_DIR/Logs/$RunDate.test.output 2>&1
50    
51    
52    cd $TEST_DIR                || finish FAILURE "Could not cd to WorkDir $TEST_DIR"
53    
54    test -d Logs || mkdir Logs
55    
56    umask 022
57    
58    test -d sandbox.$RunDate        && finish FAILURE "Today's sandbox already exists"
59    mkdir sandbox.$RunDate          || finish FAILURE "Could not mkdir sandbox"
60    cd sandbox.$RunDate         || finish FAILURE "Could not cd to sandbox"
61    
62    # Load modules
63    . /usr/share/modules/init/sh
64    module load escript/current
65    module load subversion-1.3.1
66    module load pbs
67    
68    echo "Checking out esys13/trunk"
69    svn checkout svn+ssh://shake200.esscc.uq.edu.au/home/www_svn/repos/esys13/trunk >> $TEST_DIR/Logs/$RunDate.test.output 2>&1 \
70                        || finish FAILURE "Could not check out esys13/trunk"
71    
72    export LD_LIBRARY_PATH="$TEST_DIR/lib:$LD_LIBRARY_PATH"
73    export PYTHONPATH="$TEST_DIR:$PYTHONPATH"
74    
75    # How many threads? One per CPU.
76    export OMP_NUM_THREADS=$NCPUS
77    
78    # Run the tests
79    echo "Running the tests $TEST_NAME"
80    cd trunk                || finish FAILURE "Could not cd to trunk"
81    scons dodebug=no useMPI=no -j $NCPUS $TEST_NAME >> $TEST_DIR/Logs/$RunDate.test.output 2>&1 \
82                        || finish FAILURE "Could not run scons $TEST_NAME"
83    
84    echo "Cleaning up after the tests"
85    
86    # Delete files older than 60 days
87    find $TEST_DIR -ctime +60 -exec rm -f {} \;
88    
89    finish SUCCESS "Successfully ran 'scons $TEST_NAME' on `hostname`"
90    
 # list of users to email test results to  
 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"  
 #MAIL_RECIPIENTS="jgs@esscc.uq.edu.au"  
   
 # modules to test  
 TESTS="escript bruce finley"  
   
 # the python tests to run  
 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"  
 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"  
 BRUCE_PYTESTS="ImportTest.py BruceTest.py test_utilOnBruce.py test_symbolsOnBruce.py"  
   
 echo cd $1  
 cd $1  
 if [ $? != 0 ]  
 then  
   echo couldnt cd $1  
   echo "couldnt cd $1" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
   exit 1  
 fi  
   
 PWD=`pwd`  
 echo working in: $PWD  
   
 # define compiler executable and library locations  
 export PATH=/opt/intel/cmplrs/80.058/intel_cc_80/bin:$PATH  
 export LD_LIBRARY_PATH=/opt/intel/cmplrs/80.058/intel_cc_80/lib  
   
 # define python location  
 export PATH=/raid2/tools/python-2.3.4/bin:$PATH  
   
 # set library and openmp settings  
 export LD_LIBRARY_PATH=$PWD/lib:/raid2/tools/boost/lib:$LD_LIBRARY_PATH  
 export PYTHONPATH=$PWD  
 export OMP_SCHEDULE="dynamic"  
 export OMP_NUM_THREADS=4  
 export OMP_DYNAMIC=TRUE  
 export OMP_NESTED=FALSE  
   
 FAIL=0  
   
 echo running svn update  
 svn update  
 if [ $? != 0 ]  
 then  
   echo svn update failed  
   echo "svn update failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
   exit 2  
 fi  
   
 echo running scons debug=1  
 scons debug=1  
 scons debug=1 build_tests  
 if [ $? != 0 ]  
 then  
   echo scons failed  
   echo "scons failed - see autotest-scons logfile" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
   exit 3  
 fi  
   
 echo running bruce unit_tests  
 cd bruce/test  
 ./unit_test-scons  
 if [ $? != 0 ]  
 then  
   echo bruce unit_test failed  
   echo "bruce unit_test failed - see autotest-scons logfile" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
   FAIL=1  
 fi  
 cd ../..  
   
 echo running escript unit_tests  
 cd escript/test  
 ./unit_test-scons  
 if [ $? != 0 ]  
 then  
   echo escript unit_test failed  
   echo "escript unit_test failed - see autotest-scons logfile" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
   FAIL=1  
 fi  
 cd ../..  
   
 echo running finley unit_tests  
 cd finley/test  
 ./unit_test-scons  
 if [ $? != 0 ]  
 then  
   echo finley unit_test failed  
   echo "finley unit_test failed - see autotest-scons logfile" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
   FAIL=1  
 fi  
 cd ../..  
   
 echo running esysUtils unit_tests  
 cd esysUtils/test  
 ./unit_test-scons  
 if [ $? != 0 ]  
 then  
   echo esysUtils unit_test failed  
   echo "esysUtils unit_test failed - see autotest-scons logfile" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
   FAIL=1  
 fi  
 cd ../..  
   
 for module in $TESTS  
 do  
     echo "running python tests for: $module"  
     cd $module/test/python  
     if [ "$module" == "finley" ]  
     then  
         for pytest in $FINLEY_PYTESTS  
         do  
             echo "Running python test: $pytest"  
             python $pytest  
             if [ $? != 0 ]  
             then  
               echo Python Testing FAILED for $pytest in module $module  
               echo "finley py_test: $pytest failed - see autotest-scons logfile" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
               FAIL=1  
             fi  
         done  
     elif [ "$module" == "escript" ]  
     then  
         for pytest in $ESCRIPT_PYTESTS  
         do  
             echo "Running python test: $pytest"  
             python $pytest  
             if [ $? != 0 ]  
             then  
               echo Python Testing FAILED for $pytest in module $module  
               echo "escript py_test: $pytest failed - see autotest-scons logfile" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
               FAIL=1  
             fi  
         done  
     elif [ "$module" == "bruce" ]  
     then  
         for pytest in $BRUCE_PYTESTS  
         do  
             echo "Running python test: $pytest"  
             python $pytest  
             if [ $? != 0 ]  
             then  
               echo Python Testing FAILED for $pytest in module $module  
               echo "bruce py_test: $pytest failed - see autotest-scons logfile" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
               FAIL=1  
             fi  
         done  
     fi  
     cd ../../..  
 done  
   
 if [ $FAIL == 0 ]  
 then  
     echo success  
     echo "success" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
 fi  
 exit 0  

Legend:
Removed from v.356  
changed lines
  Added in v.2368

  ViewVC Help
Powered by ViewVC 1.1.26