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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 707 - (show annotations)
Wed Apr 12 23:58:02 2006 UTC (14 years, 6 months ago) by gross
File size: 2422 byte(s)
latex build documentation is working now
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 # run all tests:
41 #
42 program = local_env.RunPyUnitTest(alltestruns)
43
44 Depends(program, pyinstall)
45 Depends(program, dep_lib)
46 Depends(program, 'build_py_tests')
47
48
49 #Add Unit Test to target alias
50 local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/bruce/test/python')))
51 local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/escript/test/python')))
52 local_env.PrependENVPath('BRUCE_TEST_DATA',str(env.Dir('#/bruce/test/python')))
53 local_env.PrependENVPath('BRUCE_WORKDIR',str(env.Dir('#/build/$PLATFORM/bruce/test/python')))
54 env.Alias('build_py_tests',test_pyc)
55 env.Alias('local_py_tests',[os.path.splitext(x)[0]+'.passed' for x in alltestruns])
56 env.Alias('py_tests', [os.path.splitext(x)[0]+'.passed' for x in testruns ])
57
58 # get all the python files in the release tar file
59 release_pyfiles = [ env.File("SConscript"), ]
60 release_datafiles=[] # FIXIT: is there a better way?
61 for d in testdata_dir:
62 release_datafiles+=[ d+"/"+x for x in os.listdir(local_env.Dir(d).srcnode().abspath) if not x.startswith('.')]
63 release_testfiles = [ env.File(x) for x in testfiles + testruns ] + [ env.File(x) for x in release_datafiles ]
64 env.Zip(src_zipfile, release_pyfiles)
65 env.Tar(src_tarfile, release_pyfiles)
66 env.Zip(test_zipfile, release_testfiles)
67 env.Tar(test_tarfile, release_testfiles)
68

  ViewVC Help
Powered by ViewVC 1.1.26