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

Diff of /branches/arrexp_2137_win/autotest-scons

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

trunk/autotest-scons revision 520 by gross, Tue Feb 14 05:45:11 2006 UTC branches/arrexp_trunk2098/autotest-scons revision 2111 by jfenwick, Mon Dec 1 01:16:18 2008 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 elspeth@esscc.uq.edu.au matt@esscc.uq.edu.au"  # MAIL_RECIPIENTS="k.steube@uq.edu.au"
8    
9  # the python tests to run  NCPUS=4
10  BRUCE_PYTESTS="ImportTest.py BruceTest.py test_utilOnBruce.py test_symbolsOnBruce.py"  TEST_DIR=/data1/ksteube/EscriptDev/AutoTests
11  ESCRIPT_PYTESTS="ImportTest.py BinaryOps.py UnaryOps.py SliceGetting.py SliceSetting.py MiscTests.py ArchiveTests.py newEscriptTests.py DataVariableTests.py test_xml.py insituTests.py s2.py"  TEST_NAME='all_tests'
12  FINLEY_PYTESTS="ImportTest.py finleyTest.py SimpleSolve.py RecTest.py test_linearPDEsOnFinley.py test_generators.py test_visualization_interface.py test_utilOnFinley.py test_symbolsOnFinley.py"  
13    RunDate=`date '+%Y_%m_%d'`  # Time stamp for log file names
14  echo "===> cd $1"  
15  cd $1  START=`date '+%Y/%m/%d %H:%M'`
16  if [ $? != 0 ]  
17  then  SCRIPT_NAME=$0
18    echo "couldnt cd $1"  
19    echo "couldnt cd $1" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  finish () {
20    exit 1    # state will be 'FAILURE' or 'SUCCESS'
21  fi    state="$1"
22      message="$2"
23  PWD=`pwd`    date
24  echo "===> working in: $PWD"    # Clean up the sandbox
25      cd $TEST_DIR
26  # define compiler executable and library locations    /bin/rm -rf sandbox.$RunDate
27  export PATH=/opt/intel/cmplrs/80.058/intel_cc_80/bin:$PATH    END=`date '+%Y/%m/%d %H:%M'`
28  export LD_LIBRARY_PATH=/opt/intel/cmplrs/80.058/intel_cc_80/lib    cat << END_MSG | mail -s "ESYS_TESTS $TEST_NAME $RunDate $state" $MAIL_RECIPIENTS
29    $message.
30  # define python location  The tests ran from $START to $END on $NCPUS cores
31  export PATH=/raid2/tools/python-2.3.4/bin:$PATH  See the log files in $TEST_DIR/Logs/$RunDate*
32    This mail was sent by $SCRIPT_NAME
33  # set library and python paths  running as $USER on `hostname`.
34  export LD_LIBRARY_PATH=$PWD/lib:/raid2/tools/boost/lib:$LD_LIBRARY_PATH  END_MSG
35  export PYTHONPATH=$PWD    # There are three ways to see errors:
36      # egrep 'FAIL|Error:|error set =' $TEST_DIR/Logs/$RunDate.test.output
37  # set openmp settings    if [ "x$state" = "xFAILURE" ]; then
38  export OMP_SCHEDULE="dynamic"      touch Logs/$RunDate.FAILURE
39  export OMP_NUM_THREADS=4      exit 1
 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  
 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 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 run_tests  
 if [ $? != 0 ]  
 then  
   echo "unit_testing failed"  
   echo "unit_test failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
   FAIL=1  
 fi  
   
 cd escript/test/python  
 for pytest in $ESCRIPT_PYTESTS  
 do  
   echo "===>running escript 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  
40    fi    fi
41  done    exit 0
42  cd ../../..  }
43    
 cd finley/test/python  
 for pytest in $FINLEY_PYTESTS  
 do  
   echo "running finley python test: $pytest"  
   python $pytest  
   if [ $? != 0 ]  
   then  
     echo "python testing failed for $pytest in module $module"  
     echo "finley py_test: $pytest failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
     FAIL=1  
   fi  
 done  
 cd ../../..  
44    
45  cd bruce/test/python  cat /dev/null > $TEST_DIR/Logs/$RunDate.test.output \
46  for pytest in $BRUCE_PYTESTS                      || finish FAILURE "Could not create out_file $TEST_DIR/Logs/$RunDate.test.output"
47  do  
48    echo "running bruce python test: $pytest"  # Save output in Logs/date.test.output
49    python $pytest  exec 1> $TEST_DIR/Logs/$RunDate.test.output 2>&1
50    if [ $? != 0 ]  
51    then  
52      echo "python testing failed for $pytest in module $module"  cd $TEST_DIR                || finish FAILURE "Could not cd to WorkDir $TEST_DIR"
53      echo "bruce py_test: $pytest failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
54      FAIL=1  test -d Logs || mkdir Logs
55    fi  
56  done  umask 022
57  cd ../../..  
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=1
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    
 if [ $FAIL == 0 ]  
 then  
     echo success  
     echo "success" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS  
 fi  
 exit 0  

Legend:
Removed from v.520  
changed lines
  Added in v.2111

  ViewVC Help
Powered by ViewVC 1.1.26