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

Diff of /trunk/autotest-scons

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

revision 365 by jgs, Thu Dec 15 05:00:05 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  # list of users to email test results to  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="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="k.steube@uq.edu.au"
 MAIL_RECIPIENTS="jgs@esscc.uq.edu.au"  
   
 # the python tests to run  
 BRUCE_PYTESTS="ImportTest.py BruceTest.py test_utilOnBruce.py test_symbolsOnBruce.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"  
 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"  
   
 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  
   
 echo "===> 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 "===> scons building esys"  
 scons debug=1  
 if [ $? != 0 ]  
 then  
   echo "scons build failed"  
   echo "scons build failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
   exit 3  
 fi  
   
 echo "===> building unit_tests"  
 scons debug=1 build_tests  
 if [ $? != 0 ]  
 then  
   echo "unit_test build failed"  
   echo "unit_test build failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
   exit 3  
 fi  
   
 FAIL=0  
   
 echo "===> running unit_tests"  
 scons debug=1 run_tests  
 if [ $? != 0 ]  
 then  
   echo "unit_testing failed"  
   echo "unit_test failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
   FAIL=1  
 fi  
   
 echo "===> running python tests for escript"  
 cd escript/test/python  
 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" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
     FAIL=1  
   fi  
 done  
 cd ../../..  
8    
9  echo "===> running python tests for finley"  NCPUS=4
10  cd finley/test/python  TEST_DIR=/data1/ksteube/EscriptDev/AutoTests
11  for pytest in $FINLEY_PYTESTS  TEST_NAME='all_tests'
12  do  
13    echo "running python test: $pytest"  RunDate=`date '+%Y_%m_%d'`  # Time stamp for log file names
14    python $pytest  
15    if [ $? != 0 ]  START=`date '+%Y/%m/%d %H:%M'`
16    then  
17      echo "python testing failed for $pytest in module $module"  SCRIPT_NAME=$0
18      echo "finley py_test: $pytest failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
19      FAIL=1  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    fi
41  done    exit 0
42  cd ../../..  }
43    
 echo "===> running python tests for bruce"  
 cd bruce/test/python  
 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" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
     FAIL=1  
   fi  
 done  
 cd ../../..  
44    
45  if [ $FAIL == 0 ]  cat /dev/null > $TEST_DIR/Logs/$RunDate.test.output \
46  then                      || finish FAILURE "Could not create out_file $TEST_DIR/Logs/$RunDate.test.output"
47      echo success  
48      echo "success" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  # Save output in Logs/date.test.output
49  fi  exec 1> $TEST_DIR/Logs/$RunDate.test.output 2>&1
50  exit 0  
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    

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

  ViewVC Help
Powered by ViewVC 1.1.26