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

Contents of /trunk/scons/scons_extensions.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1133 - (show annotations)
Tue May 8 07:19:33 2007 UTC (12 years, 2 months ago) by gross
File MIME type: text/x-python
File size: 1453 byte(s)
Changes needed for windows. This still does not work on and has not run on linux and the altix. 
 
There are a few changes in names in the scons script, in particular _libs is used rather than _lib and _libs is always a list. By default on windows MSVC is used. The location of python is at C:\Program Files\python<version>, boost at C:\Program Files\boost and netcdf at C:\Program Files\netcdf. 

 
1
2 # Copyright 2006 by ACcESS MNRF
3 #
4 # http://www.access.edu.au
5 # Primary Business: Queensland, Australia
6 # Licensed under the Open Software License version 3.0
7 # http://www.opensource.org/licenses/osl-3.0.php
8 #
9
10
11 # Extensions to Scons
12
13 import py_compile
14 import sys
15 import os
16 import time
17
18 # Code to build .pyc from .py
19 def build_py(target, source, env):
20 py_compile.compile(str(source[0]), str(target[0]))
21 return None
22
23 # Code to run unit_test executables
24 def runUnitTest(target, source, env):
25 time_start = time.time()
26 print "Executing test: " + str(source[0].abspath)
27 app = str(source[0].abspath)
28 if not env.Execute(app):
29 open(str(target[0]),'w').write("PASSED\n")
30 else:
31 return 1
32 print "Test execution time: ", round(time.time() - time_start, 1), " seconds wall time for " + str(source[0].abspath)
33 return None
34
35 def runPyUnitTest(target, source, env):
36 time_start = time.time()
37 print "Executing test: " + str(source[0].abspath)
38 app = 'python '+'"'+str(source[0].abspath)+'"'
39 if not env.Execute(app):
40 open(str(target[0]),'w').write("PASSED\n")
41 else:
42 return 1
43 print "Test execution time: ", round(time.time() - time_start, 1), " seconds wall time for " + str(source[0].abspath)
44 return None

  ViewVC Help
Powered by ViewVC 1.1.26