/[escript]/branches/lapack2681/scons/grouptest.py
ViewVC logotype

Diff of /branches/lapack2681/scons/grouptest.py

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

revision 2501 by jfenwick, Tue Apr 7 00:26:49 2009 UTC revision 2502 by gross, Tue Jun 30 05:49:22 2009 UTC
# Line 21  __url__="https://launchpad.net/escript-f Line 21  __url__="https://launchpad.net/escript-f
21    
22    
23  class GroupTest:  class GroupTest:
24      def __init__(self, exec_cmd, evars, python_dir, working_dir, test_list):      def __init__(self, exec_cmd, evars, python_dir, working_dir, test_list, single_processor_only=False):
25      self.python_dir=python_dir      self.python_dir=python_dir
26      self.working_dir=working_dir      self.working_dir=working_dir
27      self.test_list=test_list      self.test_list=test_list
28      self.exec_cmd=exec_cmd      self.exec_cmd=exec_cmd
29      self.evars=evars      self.evars=evars
30      self.mkdirs=[]      self.mkdirs=[]
31            self.single_processor_only=single_processor_only
32            
33      def makeDir(self,dirname):      def makeDir(self,dirname):
34          self.mkdirs.append(dirname)          self.mkdirs.append(dirname)
# Line 52  class GroupTest: Line 53  class GroupTest:
53    
54      def makeString(self):      def makeString(self):
55      res=""      res=""
56            if self.single_processor_only:
57                res+="if [ ( $ESCRIPT_NUM_NODES * $ESCRIPT_NUM_PROCS  ) -le 1 ]; then\n"
58                tt="\t"
59            else:
60                tt=""
61      for d in self.mkdirs:      for d in self.mkdirs:
62          res=res+"if [ ! -d "+str(d)+" ]\nthen\n  mkdir "+d+"\nfi\n"          res=res+tt+"if [ ! -d "+str(d)+" ]\n"+tt+"then\n"+tt+"\tmkdir "+d+"\n"+tt+"fi\n"
63      for v in self.evars:      for v in self.evars:
64          res=res+"\nexport "+str(v[0])+"="+str(v[1])          res=res+tt+"export "+str(v[0])+"="+str(v[1])+"\n"
65      res=res+"\nexport PYTHONPATH="+self.python_dir+":$OLD_PYTHON"+"\n"+"cd "+self.working_dir+"\n"          if len(self.python_dir)>0:
66            res=res+tt+"export PYTHONPATH="+self.python_dir+":$OLD_PYTHON"+"\n"+tt+"cd "+self.working_dir+"\n"
67            else:
68            res=res+tt+"export PYTHONPATH=$OLD_PYTHON"+"\n"+tt+"cd "+self.working_dir+"\n"
69      for t in self.test_list:      for t in self.test_list:
70          res=res+"echo Starting "+t+"\n"          res=res+tt+"echo Starting "+t+"\n"
71          res=res+self.exec_cmd+' '+t+' || failed '+t+'\n'          res=res+tt+self.exec_cmd+' '+t+' || failed '+t+'\n'
72          res=res+"echo Completed "+t+"\n"          res=res+tt+"echo Completed "+t+"\n"
73            if self.single_processor_only:
74                res+="fi\n"
75      res=res+"\n"      res=res+"\n"
76      return res      return res
77            

Legend:
Removed from v.2501  
changed lines
  Added in v.2502

  ViewVC Help
Powered by ViewVC 1.1.26