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

Contents of /trunk/downunder/test/python/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6034 - (show annotations)
Wed Mar 9 00:37:57 2016 UTC (2 years, 8 months ago) by caltinay
File size: 1996 byte(s)
a few changes to GroupTest / utest:
GroupTest class now takes a name parameter that is used as (shell) function
name in utest for the test group.
By default all tests are run as before but one can now do:
./utest.sh build '-t2' escriptcpp
to only run the escript c++ unit tests.
Also tweaked a couple things so utest.sh does now work with dash.

1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2016 by The University of Queensland
5 # http://www.uq.edu.au
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Open Software License version 3.0
9 # http://www.opensource.org/licenses/osl-3.0.php
10 #
11 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 # Development 2012-2013 by School of Earth Sciences
13 # Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 #
15 ##############################################################################
16
17 from os.path import splitext
18 Import('*')
19
20 local_env = env.Clone()
21
22 # files defining test runs (passing in a release)
23 testruns = Glob('run_*.py', strings=True)
24
25 # all tests
26 alltestruns = testruns
27
28 # test files are just compiled
29 test_pyc = env.PyCompile(testruns)
30 env.Alias('build_py_tests', test_pyc)
31
32 # add unit test to target alias
33 local_env.PrependENVPath('PYTHONPATH', env.Dir('$BUILD_DIR/$PLATFORM/escript/test/python').abspath)
34 local_env.PrependENVPath('PYTHONPATH', env.Dir('$BUILD_DIR/$PLATFORM/downunder/test/python').abspath)
35 local_env.PrependENVPath('PYTHONPATH', Dir('.').abspath)
36 local_env['ENV']['DOWNUNDER_TEST_DATA_ROOT']=Dir('ref_data').srcnode().abspath
37 local_env['ENV']['DOWNUNDER_WORKDIR']=Dir('.').abspath
38 env.Alias('local_py_tests',[splitext(x)[0]+'.passed' for x in alltestruns])
39 env.Alias('py_tests', [splitext(x)[0]+'.passed' for x in testruns])
40
41 # run all tests
42 program = local_env.RunPyUnitTest(alltestruns)
43 Depends(program, 'build_py_tests')
44
45 # add a group of tests
46 from grouptest import GroupTest
47 tgroup=GroupTest("downunder", "$PYTHONRUNNER ", (("DOWNUNDER_TEST_DATA_ROOT","$BATCH_ROOT/downunder/test/python/ref_data"),('DOWNUNDER_WORKDIR','$BUILD_DIR/downunder/test/python')), "$BATCH_ROOT/escript/test/python:$BATCH_ROOT/downunder/test/python", "$BATCH_ROOT/downunder/test/python", testruns)
48 tgroup.makeDir("$BUILD_DIR/downunder/test/python")
49 TestGroups.append(tgroup)
50

  ViewVC Help
Powered by ViewVC 1.1.26