/[escript]/trunk/site_scons/site_init.py
ViewVC logotype

Diff of /trunk/site_scons/site_init.py

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

revision 4657 by jfenwick, Thu Feb 6 06:12:20 2014 UTC revision 5017 by sshaw, Tue Jun 10 02:16:18 2014 UTC
# Line 151  def runUnitTest(target, source, env): Line 151  def runUnitTest(target, source, env):
151    print "Test execution time: ", round(time.time() - time_start, 1), " seconds wall time for " + str(source[0].abspath)    print "Test execution time: ", round(time.time() - time_start, 1), " seconds wall time for " + str(source[0].abspath)
152    return None    return None
153    
154    def binpath(env, name=None):
155        if not name:
156            return env['bininstall']
157        return os.path.join(env['bininstall'], name)
158    
159  def runPyUnitTest(target, source, env):  def runPyUnitTest(target, source, env):
160     time_start = time.time()     time_start = time.time()
161     app = str(source[0].abspath)     app = str(source[0].abspath)
# Line 163  def runPyUnitTest(target, source, env): Line 168  def runPyUnitTest(target, source, env):
168         else:         else:
169             app = "cd "+ pn +" & "+sys.executable + " " + sn             app = "cd "+ pn +" & "+sys.executable + " " + sn
170     else:     else:
171       app = "cd "+pn+"; "+os.path.join(env['bininstall'], "run-escript")+" -ov "+sn      
172         app = "cd "+pn+"; "+binpath(env, "run-escript")+" -ov "+binpath(env,
173                "../tools/testrunner.py")+" -outputfile="+os.path.join(env['build_dir'],
174                sn[:-3])+".skipped "+sn
175       print "Executing test: ",app
176       if env.Execute(app) == 0:
177          open(str(target[0]),'w').write("PASSED\n")
178       else:
179         return 1
180       print "Test execution time: ", round(time.time() - time_start, 1), " seconds wall time for " + str(source[0].abspath)
181       return None
182    
183    def runPyExample(target, source, env):
184       time_start = time.time()
185       app = str(source[0].abspath)
186       pn, sn= os.path.split(app)
187       if os.name=="nt":
188           if env['usempi']:
189               app = "cd %s & mpiexec -np %s -genvlist PYTHONPATH,OMP_NUM_THREADS,"\
190                  "FINLEY_TEST_DATA,PATH %s\pythonMPIredirect.exe %s"\
191                  %(pn,env['ENV']['ESCRIPT_NUM_NODES'],env['libinstall'],sn)
192           else:
193               app = "cd "+ pn +" & "+sys.executable + " " + sn
194       else:
195        
196         app = "cd "+pn+"; pwd; "+binpath(env, "run-escript")+" -ov "+sn
197     print "Executing test: ",app     print "Executing test: ",app
198     if env.Execute(app) == 0:     if env.Execute(app) == 0:
199        open(str(target[0]),'w').write("PASSED\n")        open(str(target[0]),'w').write("PASSED\n")

Legend:
Removed from v.4657  
changed lines
  Added in v.5017

  ViewVC Help
Powered by ViewVC 1.1.26