/[escript]/trunk/bruce/test/python/SConscript
ViewVC logotype

Contents of /trunk/bruce/test/python/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 757 - (show annotations)
Mon Jun 26 13:12:56 2006 UTC (15 years, 4 months ago) by woo409
File size: 2443 byte(s)
+ Merge of intelc_win32 branch (revision 741:755) with trunk. Tested on iVEC altix (run_tests and py_tests all pass)

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

  ViewVC Help
Powered by ViewVC 1.1.26