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

Annotation of /trunk/scons/grouptest.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2239 - (hide annotations)
Wed Feb 4 00:42:46 2009 UTC (12 years, 8 months ago) by jfenwick
File MIME type: text/x-python
File size: 1998 byte(s)
Added pyvisi and c++ unit tests to build of utest.sh
1 jfenwick 2235 ########################################################
2     #
3     # Copyright (c) 2003-2008 by University of Queensland
4     # Earth Systems Science Computational Center (ESSCC)
5     # http://www.uq.edu.au/esscc
6     #
7     # Primary Business: Queensland, Australia
8     # Licensed under the Open Software License version 3.0
9     # http://www.opensource.org/licenses/osl-3.0.php
10     #
11     ########################################################
12    
13     __copyright__="""Copyright (c) 2003-2008 by University of Queensland
14     Earth Systems Science Computational Center (ESSCC)
15     http://www.uq.edu.au/esscc
16     Primary Business: Queensland, Australia"""
17     __license__="""Licensed under the Open Software License version 3.0
18     http://www.opensource.org/licenses/osl-3.0.php"""
19     __url__="http://www.uq.edu.au/esscc/escript-finley"
20    
21     def makeHeader():
22     res="#!/bin/bash\n"
23     res=res+"function failed()\n{\n echo ""Execution failed for $@""\n exit 1\n}\n"
24 jfenwick 2239 res=res+"\nexport OLD_PYTHON=$PYTHONPATH\nBINRUNNER=$1\nPYTHONRUNNER=\"$1 $2\"\nBATCH_ROOT=`pwd`\nBUILD_DIR=$BATCH_ROOT/build/posix\n"
25 jfenwick 2235 res=res+"if [ ! -d $BUILD_DIR ]\nthen\n echo Can not find build directory $BUILD_DIR\n exit 2\nfi\n"
26 jfenwick 2239 res=res+"if [ $# -lt 2 ]\nthen\n echo Usage: $0 bin_run_cmd python_run_cmd\n exit 2\nfi\n"
27 jfenwick 2235 return res
28    
29     class GroupTest:
30 jfenwick 2239 def __init__(self, exec_cmd, evars, python_dir, working_dir, test_list):
31 jfenwick 2235 self.python_dir=python_dir
32     self.working_dir=working_dir
33     self.test_list=test_list
34     self.exec_cmd=exec_cmd
35 jfenwick 2239 self.evars=evars
36 jfenwick 2235 self.mkdirs=[]
37    
38     def makeDir(self,dirname):
39     self.mkdirs.append(dirname)
40    
41     def makeString(self):
42     res=""
43     for d in self.mkdirs:
44     res="if [ ! -d "+str(d)+" ]\nthen\n mkdir "+d+"\nfi"
45 jfenwick 2239 for v in self.evars:
46 jfenwick 2235 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"
48     for t in self.test_list:
49     res=res+"echo Starting "+t+"\n"
50     res=res+self.exec_cmd+' '+t+' || failed '+t+'\n'
51     res=res+"echo Completed "+t+"\n"
52     res=res+"\n"
53     return res
54    

  ViewVC Help
Powered by ViewVC 1.1.26