/[escript]/branches/schroedinger_upto1946/autotest-scons
ViewVC logotype

Diff of /branches/schroedinger_upto1946/autotest-scons

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

trunk/autotest-scons revision 331 by svn, Wed Dec 7 06:46:24 2005 UTC branches/schroedinger_upto1946/autotest-scons revision 1947 by jfenwick, Wed Oct 29 23:19:45 2008 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2    
3  # $Id: autotest 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"
8    
9  #modules to test  NCPUS=4
10  TESTS="escript bruce finley"  TEST_DIR=/data1/ksteube/EscriptDev/AutoTests
11    TEST_NAME='all_tests'
12    
13  # the python tests to run  RunDate=`date '+%Y_%m_%d'`  # Time stamp for log file names
14  FINLEY_PYTESTS="ImportTest.py SimpleSolve.py GradTest.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 newEscriptTests.py DataVariableTests.py test_xml.py"  START=`date '+%Y/%m/%d %H:%M'`
16  ESCRIPT_PYTESTS="ImportTest.py BinaryOps.py UnaryOps.py SliceGetting.py SliceSetting.py MiscTests.py newEscriptTests.py DataVariableTests.py"  
17  BRUCE_PYTESTS="ImportTest.py BruceTest.py test_utilOnBruce.py test_symbolsOnBruce.py"  SCRIPT_NAME=$0
18    
19    finish () {
20  # define compiler executable and library locations    # state will be 'FAILURE' or 'SUCCESS'
21  export PATH=/opt/intel/cmplrs/80.058/intel_cc_80/bin:$PATH    state="$1"
22  export LD_LIBRARY_PATH=/opt/intel/cmplrs/80.058/intel_cc_80/lib    message="$2"
23      date
24  echo cd $1    # Clean up the sandbox
25  cd $1    cd $TEST_DIR
26  if [ $? != 0 ]    /bin/rm -rf sandbox.$RunDate
27  then    END=`date '+%Y/%m/%d %H:%M'`
28    echo couldnt cd $1    cat << END_MSG | mail -s "ESYS_TESTS $TEST_NAME $RunDate $state" $MAIL_RECIPIENTS
29    echo "couldnt cd $1" | mail -s "esys autotest results" $MAIL_RECIPIENTS  $message.
30    exit 1  The tests ran from $START to $END on $NCPUS cores
31  fi  See the log files in $TEST_DIR/Logs/$RunDate*
32    This mail was sent by $SCRIPT_NAME
33  echo loading esys setup  running as $USER on `hostname`.
34  . ~jgs/bin/scons_setup  END_MSG
35  if [ $? != 0 ]    # There are three ways to see errors:
36  then    # egrep 'FAIL|Error:|error set =' $TEST_DIR/Logs/$RunDate.test.output
37    echo couldnt load scons setup    if [ "x$state" = "xFAILURE" ]; then
38    echo "couldnt load scons setup" | mail -s "esys autotest results" $MAIL_RECIPIENTS      touch Logs/$RunDate.FAILURE
39    exit 2      exit 1
40  fi    fi
41      exit 0
42  echo running svn update  }
43  svn update  
44  if [ $? != 0 ]  
45  then  cat /dev/null > $TEST_DIR/Logs/$RunDate.test.output \
46    echo svn update failed                      || finish FAILURE "Could not create out_file $TEST_DIR/Logs/$RunDate.test.output"
47    echo "svn update failed" | mail -s "esys autotest results" $MAIL_RECIPIENTS  
48    exit 3  # Save output in Logs/date.test.output
49  fi  exec 1> $TEST_DIR/Logs/$RunDate.test.output 2>&1
50    
51  echo running scons debug=1  
52  scons debug=1  cd $TEST_DIR                || finish FAILURE "Could not cd to WorkDir $TEST_DIR"
53  if [ $? != 0 ]  
54  then  test -d Logs || mkdir Logs
55    echo scons failed  
56    echo "scons failed - see autotest logfile" | mail -s "esys autotest results" $MAIL_RECIPIENTS  umask 022
57    exit 5  
58  fi  test -d sandbox.$RunDate        && finish FAILURE "Today's sandbox already exists"
59    mkdir sandbox.$RunDate          || finish FAILURE "Could not mkdir sandbox"
60  echo running bruce unit_tests  cd sandbox.$RunDate         || finish FAILURE "Could not cd to sandbox"
61  cd bruce/test  
62  ./unit_test-scons  # Load modules
63  if [ $? != 0 ]  . /usr/share/modules/init/sh
64  then  module load escript/current
65    echo bruce unit_test failed  module load subversion-1.3.1
66    echo "bruce unit_test failed - see autotest logfile" | mail -s "esys autotest results" $MAIL_RECIPIENTS  module load pbs
67    exit 6  
68  fi  echo "Checking out esys13/trunk"
69  cd ../..  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  echo running escript unit_tests  
72  cd escript/test  export LD_LIBRARY_PATH="$TEST_DIR/lib:$LD_LIBRARY_PATH"
73  ./unit_test-scons  export PYTHONPATH="$TEST_DIR:$PYTHONPATH"
74  if [ $? != 0 ]  
75  then  # How many threads? One per CPU.
76    echo escript unit_test failed  export OMP_NUM_THREADS=1
77    echo "escript unit_test failed - see autotest logfile" | mail -s "esys autotest results" $MAIL_RECIPIENTS  
78    exit 6  # Run the tests
79  fi  echo "Running the tests $TEST_NAME"
80  cd ../..  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  echo running finley unit_tests                      || finish FAILURE "Could not run scons $TEST_NAME"
83  cd finley/test  
84  ./unit_test-scons  echo "Cleaning up after the tests"
85  if [ $? != 0 ]  
86  then  # Delete files older than 60 days
87    echo finley unit_test failed  find $TEST_DIR -ctime +60 -exec rm -f {} \;
88    echo "finley unit_test failed - see autotest logfile" | mail -s "esys autotest results" $MAIL_RECIPIENTS  
89    exit 6  finish SUCCESS "Successfully ran 'scons $TEST_NAME' on `hostname`"
 fi  
 cd ../..  
   
 export LD_LIBRARY_PATH=/raid2/tools/python-2.3.4/lib:$LD_LIBRARY_PATH  
 export PYTHON_INCLUDE=/raid2/tools/python-2.3.4/include/python2.3  
 export PYTHON_LIB_PATH=/raid2/tools/python-2.3.4/lib  
 export PATH=/raid2/tools/python-2.3.4/bin:$PATH  
   
 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 failed - see autotest logfile" | mail -s "esys autotest results" $MAIL_RECIPIENTS  
               exit 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 failed - see autotest logfile" | mail -s "esys autotest results" $MAIL_RECIPIENTS  
               exit 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 failed - see autotest logfile" | mail -s "esys autotest results" $MAIL_RECIPIENTS  
               exit 1  
             fi  
         done  
     fi  
     cd ../../..  
 done  
90    
 echo "success" | mail -s "esys autotest results" $MAIL_RECIPIENTS  
 exit 0  

Legend:
Removed from v.331  
changed lines
  Added in v.1947

  ViewVC Help
Powered by ViewVC 1.1.26