/[escript]/branches/scons-dev/bruce/test/python/SConscript
ViewVC logotype

Contents of /branches/scons-dev/bruce/test/python/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1658 - (show annotations)
Thu Jul 17 04:10:35 2008 UTC (11 years, 2 months ago) by ksteube
File size: 2185 byte(s)
Improved handling of scons 0.98 versus 0.96

1 #
2 # $Id$
3 #
4 #######################################################
5 #
6 # Copyright 2003-2007 by ACceSS MNRF
7 # Copyright 2007 by University of Queensland
8 #
9 # http://esscc.uq.edu.au
10 # Primary Business: Queensland, Australia
11 # Licensed under the Open Software License version 3.0
12 # http://www.opensource.org/licenses/osl-3.0.php
13 #
14 #######################################################
15 #
16
17 import os
18 Import('*')
19
20 if 'Clone' in dir(env): local_env = env.Clone() # scons-0.98
21 else: local_env = env.Copy() # scons-0.96
22
23 src_dir = local_env.Dir('.').srcnode().abspath
24 filenames = os.listdir(src_dir)
25 #
26 # files defining tests but are not running by itself:
27 #
28 testfiles = [x for x in filenames if x.startswith('test_') and os.path.splitext(x)[1] in ['.py'] ]
29 #
30 # directories defining test data
31 #
32 testdata_dir = [x for x in filenames if x.startswith('data_') ]
33 #
34 # files defining test runs (passing in a release)
35 #
36 testruns = [x for x in filenames if x.startswith('run_') and os.path.splitext(x)[1] in ['.py'] ]
37 #
38 # files defining tests run locally (not as part of a release)
39 #
40 localtestruns = [x for x in filenames if not x.startswith('run_') and os.path.splitext(x)[1] in ['.py']]
41 #
42 # all test
43 #
44 alltestruns = testruns + localtestruns
45 #
46 # test files are just compiled:
47 #
48 test_pyc = env.PyCompile(testfiles)
49 env.Alias('build_py_tests',test_pyc)
50
51 #Add Unit Test to target alias
52 local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/bruce/test/python')))
53 local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/escript/test/python')))
54 local_env['ENV']['BRUCE_TEST_DATA']=local_env.Dir('#/bruce/test/python').srcnode().abspath
55 local_env['ENV']['BRUCE_WORKDIR']=local_env.Dir('#/build/$PLATFORM/bruce/test/python').srcnode().abspath
56 env.Alias('build_py_tests',test_pyc)
57 env.Alias('local_py_tests',[os.path.splitext(x)[0]+'.passed' for x in alltestruns])
58 env.Alias('py_tests', [os.path.splitext(x)[0]+'.passed' for x in testruns ])
59
60 #
61 # run all tests:
62 #
63 program = local_env.RunPyUnitTest(alltestruns)
64
65 Depends(program, local_env['pyinstall'])
66 Depends(program, dep_lib)
67 Depends(program, 'build_py_tests')

  ViewVC Help
Powered by ViewVC 1.1.26