/[escript]/trunk/scons/grouptest.py
ViewVC logotype

Diff of /trunk/scons/grouptest.py

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

revision 2235 by jfenwick, Tue Feb 3 01:47:47 2009 UTC revision 2239 by jfenwick, Wed Feb 4 00:42:46 2009 UTC
# Line 21  __url__="http://www.uq.edu.au/esscc/escr Line 21  __url__="http://www.uq.edu.au/esscc/escr
21  def makeHeader():  def makeHeader():
22      res="#!/bin/bash\n"      res="#!/bin/bash\n"
23      res=res+"function failed()\n{\n  echo ""Execution failed for $@""\n  exit 1\n}\n"      res=res+"function failed()\n{\n  echo ""Execution failed for $@""\n  exit 1\n}\n"
24      res=res+"\nexport OLD_PYTHON=$PYTHONPATH\nexport PYTHONRUNNER=$1\nBATCH_ROOT=`pwd`\nBUILD_DIR=$BATCH_ROOT/build/posix\n"      res=res+"\nexport OLD_PYTHON=$PYTHONPATH\nBINRUNNER=$1\nPYTHONRUNNER=\"$1 $2\"\nBATCH_ROOT=`pwd`\nBUILD_DIR=$BATCH_ROOT/build/posix\n"
25      res=res+"if [ ! -d $BUILD_DIR ]\nthen\n echo Can not find build directory $BUILD_DIR\n exit 2\nfi\n"      res=res+"if [ ! -d $BUILD_DIR ]\nthen\n echo Can not find build directory $BUILD_DIR\n exit 2\nfi\n"
26      res=res+"if [ $# -lt 1 ]\nthen\n echo Usage: $0 python_run_cmd\n exit 2\nfi\n"      res=res+"if [ $# -lt 2 ]\nthen\n echo Usage: $0 bin_run_cmd python_run_cmd\n exit 2\nfi\n"
27      return res      return res
28    
29  class GroupTest:  class GroupTest:
30      def __init__(self, exec_cmd, vars, python_dir, working_dir, test_list):      def __init__(self, exec_cmd, evars, python_dir, working_dir, test_list):
31      self.python_dir=python_dir      self.python_dir=python_dir
32      self.working_dir=working_dir      self.working_dir=working_dir
33      self.test_list=test_list      self.test_list=test_list
34      self.exec_cmd=exec_cmd      self.exec_cmd=exec_cmd
35      self.vars=vars      self.evars=evars
36      self.mkdirs=[]      self.mkdirs=[]
37            
38      def makeDir(self,dirname):      def makeDir(self,dirname):
# Line 42  class GroupTest: Line 42  class GroupTest:
42      res=""      res=""
43      for d in self.mkdirs:      for d in self.mkdirs:
44          res="if [ ! -d "+str(d)+" ]\nthen\n  mkdir "+d+"\nfi"          res="if [ ! -d "+str(d)+" ]\nthen\n  mkdir "+d+"\nfi"
45      for v in self.vars:      for v in self.evars:
46          res=res+"\nexport "+str(v[0])+"="+str(v[1])          res=res+"\nexport "+str(v[0])+"="+str(v[1])
47      res=res+"\nexport PYTHONPATH="+self.python_dir+":$OLD_PYTHON"+"\n"+"cd "+self.working_dir+"\n"      res=res+"\nexport PYTHONPATH="+self.python_dir+":$OLD_PYTHON"+"\n"+"cd "+self.working_dir+"\n"
48      for t in self.test_list:      for t in self.test_list:

Legend:
Removed from v.2235  
changed lines
  Added in v.2239

  ViewVC Help
Powered by ViewVC 1.1.26