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

Diff of /branches/more_shared_ptrs_from_1812/autotest-scons

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

revision 739 by ksteube, Tue Jun 20 00:52:56 2006 UTC revision 757 by woo409, Mon Jun 26 13:12:56 2006 UTC
# Line 1  Line 1 
1  #!/bin/sh  #!/bin/bash
2    #          Copyright 2006 by ACcESS MNRF
 #  
 # Submit a PBS job to run the tests  
3  #  #
4  #   Usage: autotest-scons       # Short testing, only C++ tests  #              http://www.access.edu.au
5  #   Usage: autotest-scons run_tests # Short testing, only C++ tests  #       Primary Business: Queensland, Australia
6  #   Usage: autotest-scons all_tests # Long testing, C++ and python tests  #  Licensed under the Open Software License version 3.0
7    #     http://www.opensource.org/licenses/osl-3.0.php
8  #  #
 # Copy this somewhere and run it every day via cron  
9  #  #
 # This file should be maintained in SVN as esys13/trunk/autotest-scons,  
 # be sure to copy it there and commit after modification  
10  #  #
11    # $Id: autotest-scons 162 2005-11-11 00:09:59Z svn $
12    # An explicit testing script for esys using the scons build system
13    
14  # TODO: should try using the entire node: scons -j $NCPUS all_tests  # list of users to email test results to
15  # I've been told this produces poor results...why?  # currently disabled during testing.
16    # MAIL_RECIPIENTS="gross@esscc.uq.edu.au elspeth@esscc.uq.edu.au matt@esscc.uq.edu.au robert.woodcock@csiro.au Peter.Hornby@csiro.au"
17  # Which tests should we run?  MAIL_RECIPIENTS="elspeth@esscc.uq.edu.au"
18  target='run_tests'  # Default scons target that runs the tests  
19  test "x$1" != "x" && target="$1"  # the python tests to run
20    BRUCE_PYTESTS="ImportTest.passed BruceTest.passed test_utilOnBruce.py"
21  MAIL_RECIPIENTS="gross@esscc.uq.edu.au elspeth@esscc.uq.edu.au matt@esscc.uq.edu.au robert.woodcock@csiro.au Peter.Hornby@csiro.au k.steube@uq.edu.au"  ESCRIPT_PYTESTS="ImportTest.passed BinaryOps.passed UnaryOps.passed SliceGetting.passed SliceSetting.passed MiscTests.passed ArchiveTests.passed newEscriptTests.passed test_xml.passed insituTests.passed s2.passed"
22  # MAIL_RECIPIENTS="k.steube@uq.edu.au"  FINLEY_PYTESTS="ImportTest.passed finleyTest.passed SimpleSolve.passed RecTest.passed test_linearPDEsOnFinley.passed test_generators.passed test_visualization_interface.passed test_utilOnFinley.passed"
23    
24  RunDate=`date '+%Y_%m_%d'`  # Time stamp for log file names  # Changed slightly to cope with new script, so it doesn't stomp all over previous iterations
25    
26  WorkDir=/raid3/ksteube/AutoTests  echo "===> cd $1"
27  cd $WorkDir  cd $1
28    if [ $? != 0 ]
29  # Where to put the output of scons run_tests  then
30  out_file="$WorkDir/Logs/$RunDate.test.output"    echo "couldnt cd $1"
31      echo "couldnt cd $1" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS
32  # Save the name of this script    exit 1
33  SCRIPT_NAME=$0  fi
34    
35  # Below here \$variable means I want the variable interpreted when PBS runs the job, not when the job is submitted  # this is for the automated script
36  # Similarly for \`...\`  echo "===> change up a directory"
37    cd ..
38  # Write the PBS script to run the tests  echo "===> make a sandbox and work in that"
39  cat << EOF > Logs/$RunDate.pbs.script.sh  mkdir sandbox
40  #!/bin/bash  cd sandbox
41    
42  #PBS -q q1  PWD=`pwd`
43  #PBS -l ncpus=2  echo "===> working in: $PWD"
44  #PBS -o $RunDate.pbs.stdout  
45  #PBS -e $RunDate.pbs.stderr  # Setup the environment
46    echo "loading modules"
47  echo "PBS_JOBNAME       \$PBS_JOBNAME"  . ${MODULESHOME}/init/sh
48  echo "PBS_JOBID         \$PBS_JOBID"  module load intel_cc.9.0.026
49  echo "PBS_QUEUE         \$PBS_QUEUE"  export MODULEPATH=${MODULEPATH}:/data/raid2/toolspp4/modulefiles/gcc-3.3.6
50  echo "NCPUS             \$NCPUS"  module load python/2.4.1
 echo "USER              \$USER"  
 echo "PBS_O_HOST        \$PBS_O_HOST"  
 echo "PBS_O_WORKDIR     \$PBS_O_WORKDIR"  
 echo "PBS_O_SHELL       \$PBS_O_SHELL"  
 echo ""  
 echo ""  
   
   
   
 START=\`date '+%Y/%m/%d %H:%M'\`  
   
 finish () {  
   END=\`date '+%Y/%m/%d %H:%M'\`  
   cat << END_MSG | mail -s "ESYS_TESTS $target $RunDate \$1" $MAIL_RECIPIENTS  
 \$2.  
 The tests ran from \$START to \$END.  
 See the log files in $WorkDir/Logs for more information.  
 This mail was sent by $SCRIPT_NAME  
 running as \$USER on \`hostname\`.  
 END_MSG  
   test "x$1" = "FAIL" && exit 1  
   exit 0  
 }  
   
   
 cd $WorkDir             || finish FAILURE "Could not cd to WorkDir $WorkDir"  
   
 # Create an empty out_file  
 cat /dev/null > $out_file       || finish FAILURE "Could not create out_file $out_file"  
   
 umask 022  
   
 test -d sandbox.$RunDate        && finish FAILURE "Today's sandbox already exists"  
 mkdir sandbox.$RunDate          || finish FAILURE "Could not mkdir sandbox"  
 cd sandbox.$RunDate         || finish FAILURE "Could not cd to sandbox"  
   
 echo "Checking out esys13/trunk"  
 svn checkout svn+ssh://shake200.esscc.uq.edu.au/home/www_svn/repos/esys13/trunk >> $out_file 2>&1 || finish FAILURE "Could not check out esys13/trunk"  
   
 # Load modules  
 . /opt/modules/default/init/bash  
 module use /raid2/matt/modules/modulefiles  
 module use /raid2/toolspp4/modulefiles/gcc-3.3.6  
 module use /usr/share/modules/modulefiles  
 module load esys/env    # Matt's recommended modules  
 module load doxygen/1.4.6  
 # The next line is to avoid /raid3/ksteube/AutoTests/sandbox.2006_06_17/trunk/build/posix/bruce/test/bruce_UnitTest: error while loading shared libraries: libboost_python-mt-d.so.1.33.0: cannot open shared object file: No such file or directory  
51  module load boost/1.33.0/python-2.4.1  module load boost/1.33.0/python-2.4.1
52    module load numarray/1.3.3
53    
54    # set openmp settings
55    export OMP_NUM_THREADS=4
56    
57  # Had to request 2 CPUs, but only use one for the tests  # doesn't appear to work - don't know why.
58  export OMP_NUM_THREADS=1  #echo "===> svn update"
59    #svn update
60  # Run the tests  #if [ $? != 0 ]
61  echo "Running the tests"  #then
62  cd trunk                || finish FAILURE "Could not cd to trunk"  #  echo "svn update failed"
63  scons $target >> $out_file 2>&1     || finish FAILURE "Could not run scons $target"  #  echo "svn update failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS
64    #  exit 2
65  # Delete files older than 21 days  #fi
66  find $WorkDir -atime +21 -exec rm -f {} \;  
67    # Need to test this bit yet.
68  # Clean up the sandbox  echo "==> removing previous checkout"
69  cd $WorkDir             || finish FAILURE "Could not cd to clean up WorkDir $WorkDir"  rm -rf trunk/
70  /bin/rm -rf sandbox.$RunDate        || finish FAILURE "Could not delete sandbox"  ls
71    # This works - temporarily removed to speed up testing.
72  finish SUCCESS "Successfully ran 'scons $target', see Logs in $WorkDir on ess"  echo "==> svn checkout"
73    svn checkout svn+ssh://ess/esys13/trunk
74  EOF  if [ $? != 0 ]
75    then
76  # cd to the logs area so the PBS logs are deposited there      echo "svn checkout failed"
77  cd $WorkDir/Logs      echo "svn checkout failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS
78        exit 2
79  # Submit the job  fi
80  . /opt/modules/default/init/sh  
81  module load pbspro  echo "==> change to trunk"
82  qsub -S /bin/bash $RunDate.pbs.script.sh > /dev/null  ls trunk
83    cd trunk
84    
85    # This bit works. Commented out to speed up testing.
86    echo "===> scons building esys"
87    scons
88    if [ $? != 0 ]
89    then
90      echo "scons build failed"
91      echo "scons build failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS
92      exit 3
93    fi
94    
95    # This bit works. Commented out to speed up testing.
96    echo "===> building unit_tests"
97    scons build_all_tests
98    if [ $? != 0 ]
99    then
100      echo "build_tests failed"
101      echo "build_tests failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS
102      exit 3
103    fi
104    
105    FAIL=0
106    
107    #echo "===> running all tests"
108    #scons all_tests
109    if [ $? != 0 ]
110    then
111      echo "all_tests failed"
112      echo "all_tests failed" | mail -s "esys autotest-scons results" $MAIL_RECIPIENTS
113      exit 4
114    fi

Legend:
Removed from v.739  
changed lines
  Added in v.757

  ViewVC Help
Powered by ViewVC 1.1.26