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 = [] |
21 |
testruns += ['run_escriptOnFinley.py'] |
22 |
testruns += ['run_generators.py'] |
23 |
testruns += ['run_inputOutput.py'] |
24 |
testruns += ['run_linearPDEsOnFinley1.py'] |
25 |
testruns += ['run_linearPDEsOnFinley2.py'] |
26 |
testruns += ['run_linearPDEsOnFinley3.py'] |
27 |
testruns += ['run_linearPDEsOnFinleyMacro.py'] |
28 |
testruns += ['run_models.py'] |
29 |
testruns += ['run_simplesolve.py'] |
30 |
testruns += ['run_utilOnFinley.py'] |
31 |
testruns += ['run_visualization_interface.py'] |
32 |
# testruns += ['run_amg.py'] removed for now |
33 |
|
34 |
# files defining a few tests for a quick test |
35 |
scalable_tests = [] |
36 |
scalable_tests += ['run_inputOutput.py'] |
37 |
scalable_tests += ['run_simplesolve.py'] |
38 |
|
39 |
# files defining tests run locally (not as part of a release) |
40 |
localtestruns = [x for x in Glob('*.py', strings=True) if not x.startswith('run_')] |
41 |
|
42 |
# all tests |
43 |
alltestruns = testruns + localtestruns |
44 |
|
45 |
# test files are just compiled - none of those in finley yet |
46 |
#sources = Glob('test_*.py') |
47 |
#test_pyc = env.PyCompile(sources) |
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/finley/test/python'))) |
52 |
local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/escript/test/python'))) |
53 |
local_env['ENV']['FINLEY_TEST_DATA']=env.Dir('#/finley/test/python').srcnode().abspath |
54 |
local_env['ENV']['FINLEY_WORKDIR']=env.Dir('#/build/$PLATFORM/finley/test/python').srcnode().abspath |
55 |
env.Alias('local_py_tests',[splitext(x)[0]+'.passed' for x in alltestruns]) |
56 |
env.Alias('py_tests', [splitext(x)[0]+'.passed' for x in testruns ]) |
57 |
env.Alias('scalable_tests', [splitext(x)[0]+'.passed' for x in scalable_tests]) |
58 |
|
59 |
# run all tests |
60 |
program = local_env.RunPyUnitTest(alltestruns) |
61 |
Depends(program, py_wrapper_lib) |
62 |
|
63 |
# add a group of tests |
64 |
from grouptest import * |
65 |
tgroup=GroupTest("$PYTHONRUNNER ",(("FINLEY_TEST_DATA","$BATCH_ROOT/finley/test/python"),('FINLEY_WORKDIR','$BUILD_DIR/finley/test/python')),"$BUILD_DIR/escript/test/python:$BUILD_DIR/finley/test/python","$BATCH_ROOT/finley/test/python",testruns) |
66 |
tgroup.makeDir("$BUILD_DIR/finley/test/python") |
67 |
TestGroups.append(tgroup) |
68 |
|