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

Contents of /trunk/pycad/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: 2014 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 = ['run_pycad_test.py']
24
25 # files defining tests run locally (not as part of a release)
26 localtestruns = [x for x in Glob('*.py', strings=True) if not x.startswith('run_')]
27
28 # all tests
29 alltestruns = testruns + localtestruns
30
31 # test files are just compiled - none of those in pycad yet
32 sources = Glob('run_*.py')
33 test_pyc = env.PyCompile(sources)
34 env.Alias('build_py_tests', test_pyc)
35
36 # add unit test to target alias
37 local_env.PrependENVPath('PYTHONPATH', Dir('#/pycad/test/python'))
38 local_env.PrependENVPath('PYTHONPATH', Dir('.').abspath)
39 local_env['ENV']['ESCRIPT_TEST_DATA_ROOT']=Dir('.').srcnode().abspath
40 local_env['ENV']['ESCRIPT_WORKDIR']=Dir('.').abspath
41 env.Alias('local_py_tests',[splitext(x)[0]+'.passed' for x in alltestruns])
42 env.Alias('py_tests', [splitext(x)[0]+'.passed' for x in testruns])
43
44 # run all tests
45 program = local_env.RunPyUnitTest(alltestruns)
46 Depends(program, 'build_py_tests')
47 if env['usempi']:
48 Depends(program, env['prefix']+"/lib/pythonMPI")
49
50 # add a group of tests
51 from grouptest import GroupTest
52 tgroup=GroupTest("pycad", "$PYTHONRUNNER ", (("ESCRIPT_TEST_DATA_ROOT","$BATCH_ROOT/pycad/test/python"),("ESCRIPT_WORKDIR","$BUILD_DIR/pycad/test/python")), "$BATCH_ROOT/pycad/test/python", "$BATCH_ROOT/pycad/test/python", testruns)
53 TestGroups.append(tgroup)
54

  ViewVC Help
Powered by ViewVC 1.1.26