/[escript]/branches/ROBW_XPLATFORM/scons/scons_extensions.py
ViewVC logotype

Contents of /branches/ROBW_XPLATFORM/scons/scons_extensions.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 676 - (show annotations)
Sun Mar 26 10:13:34 2006 UTC (15 years, 5 months ago) by robwdcock
File MIME type: text/x-python
File size: 2098 byte(s)
+ Modified test SConscript dependencies to remove redundant call to explicit dependency
+ Modified scon_extensions.py - run unit tests (py and C++) now use scons::Execute rather than python os.system. This ensures the development environment
is used rather than the users environment to run the tests
+ SConstruct file now sets up LD_LIBRARY_PATH and PYTHONPATH to point to the current builds pyinstall and libinstall paths as required.
IT IS NO LONGER NECESSARY TO SET LD_LIBRARY_PATH and PYTHONPATH to point at your build outputs. Much safer in the presence of multiple checked out builds.
Under these circumstances you are better of using scons to run the tests rather than doing so directly. Easiest way to do this is to build the test output target for the test you want:
e.g. scons build/posix/bruce/test/python/ImportTest.passed
or if you prefer
cd build/posix/bruce/test/python
scons -u ImportTest.passed


1 # Extensions to Scons
2
3 import py_compile
4 import sys
5 import os
6
7 # Code to build .pyc from .py
8 def build_py(target, source, env):
9 py_compile.compile(str(source[0]), str(target[0]))
10 return None
11
12 # Code to run unit_test executables
13 def runUnitTest(target, source, env):
14 app = str(source[0].abspath)
15 if not env.Execute(app):
16 open(str(target[0]),'w').write("PASSED\n")
17 else:
18 return 1
19 return None
20
21 def runPyUnitTest(target, source, env):
22 app = 'python '+str(source[0].abspath)
23 if not env.Execute(app):
24 open(str(target[0]),'w').write("PASSED\n")
25 else:
26 return 1
27 return None
28
29 # code to build epydoc docs
30 def build_epydoc(target, source, env):
31 # get where I am currently, just as a reference
32 pwd = os.getcwd()
33
34 # get the full path of the runepydoc script
35 runepydoc = str(source[0].abspath)
36
37 # use this path to work out where the doc directory is
38 dirs = runepydoc.split('/')
39 dirs = dirs[:-3] # trim the last two entries: this is now the doc dir path
40 docdir = '/'.join(dirs) # this is the backwards python way to do it
41 # (I'm feeling in a perl mood today...)
42
43 # change into the relevant dir
44 os.chdir(docdir)
45
46 # run the epydoc script
47 if not os.system(runepydoc):
48 os.chdir(pwd)
49 open(str(target[0]), 'w').write("Documentation built\n")
50 else:
51 return 1
52 return None
53
54 # build doxygen docs
55 def build_doxygen(target, source, env):
56 # get where I am currently, just as a reference
57 pwd = os.getcwd()
58
59 # get the full path of the rundoxygen script
60 rundoxygen = str(source[0].abspath)
61
62 # use this path to work out where the doc directory is
63 dirs = rundoxygen.split('/')
64 dirs = dirs[:-2] # trim the last two entries: this is now the doc dir path
65 docdir = '/'.join(dirs) # this is the backwards python way to do it
66 # (I'm feeling in a perl mood today...)
67
68 # change into the relevant dir
69 os.chdir(docdir)
70
71 # run the doxygen script
72 if not os.system(rundoxygen):
73 os.chdir(pwd)
74 open(str(target[0]), 'w').write("Documentation built\n")
75 else:
76 return 1
77 return None

  ViewVC Help
Powered by ViewVC 1.1.26