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

Contents of /trunk/escript/test/python/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2398 - (show annotations)
Tue Apr 28 04:41:53 2009 UTC (11 years, 3 months ago) by gross
File size: 2217 byte(s)
first version of units in escript



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

  ViewVC Help
Powered by ViewVC 1.1.26