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

Diff of /trunk/autotest-scons

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

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

Legend:
Removed from v.319  
changed lines
  Added in v.1707

  ViewVC Help
Powered by ViewVC 1.1.26