/[escript]/branches/domexper/modellib/test/python/SConscript
ViewVC logotype

Contents of /branches/domexper/modellib/test/python/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3251 - (show annotations)
Thu Oct 7 04:02:30 2010 UTC (8 years, 7 months ago) by jfenwick
File size: 2072 byte(s)
Merged sconcript changes - weipa doesn't build unit test binary
1
2 ########################################################
3 #
4 # Copyright (c) 2003-2010 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 from os.path import splitext
15 Import('*')
16
17 local_env = env.Clone()
18
19 # files defining test runs (passing in a release)
20 testruns = ['run_convection.py']
21 testruns += ['run_flow.py']
22 testruns += ['run_temp.py']
23
24 # files defining tests run locally (not as part of a release)
25 localtestruns = [x for x in Glob('*.py', strings=True) if not x.startswith('run_')]
26
27 # all tests
28 alltestruns = testruns + localtestruns
29
30 # test files are just compiled - none of those in modellib yet
31 #sources = Glob('test_*.py')
32 #test_pyc = env.PyCompile(sources)
33 #env.Alias('build_py_tests', test_pyc)
34
35 # add unit test to target alias
36 local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/escript/test/python')))
37 local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/modellib/test/python')))
38 local_env['ENV']['MODELLIB_TEST_DATA_ROOT']=env.Dir('#/modellib/test/python').srcnode().abspath
39 local_env['ENV']['MODELLIB_WORKDIR']=env.Dir('#/build/$PLATFORM/modellib/test/python').srcnode().abspath
40 env.Alias('local_py_tests',[splitext(x)[0]+'.passed' for x in alltestruns])
41 env.Alias('py_tests', [splitext(x)[0]+'.passed' for x in testruns])
42
43 # run all tests
44 program = local_env.RunPyUnitTest(alltestruns)
45 Depends(program, 'build_py_tests')
46
47 # add a group of tests
48 from grouptest import *
49 tgroup=GroupTest("$PYTHONRUNNER ",(("MODELLIB_TEST_DATA_ROOT","$BATCH_ROOT/modellib/test/python"),('MODELLIB_WORKDIR','$BUILD_DIR/modellib/test/python')),"$BUILD_DIR/escript/test/python:$BUILD_DIR/modellib/test/python","$BATCH_ROOT/modellib/test/python",testruns)
50 tgroup.makeDir("$BUILD_DIR/modellib/test")
51 tgroup.makeDir("$BUILD_DIR/modellib/test/python")
52 TestGroups.append(tgroup)
53

  ViewVC Help
Powered by ViewVC 1.1.26