1 |
ksteube |
1811 |
|
2 |
|
|
######################################################## |
3 |
ksteube |
1705 |
# |
4 |
ksteube |
1811 |
# Copyright (c) 2003-2008 by University of Queensland |
5 |
|
|
# Earth Systems Science Computational Center (ESSCC) |
6 |
|
|
# http://www.uq.edu.au/esscc |
7 |
ksteube |
1705 |
# |
8 |
ksteube |
1811 |
# 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 |
ksteube |
1705 |
# |
12 |
ksteube |
1811 |
######################################################## |
13 |
ksteube |
1705 |
|
14 |
ksteube |
1811 |
|
15 |
ksteube |
1705 |
import os |
16 |
robwdcock |
661 |
Import('*') |
17 |
ksteube |
1705 |
|
18 |
|
|
local_env = clone_env(env) |
19 |
|
|
|
20 |
robwdcock |
661 |
src_dir = local_env.Dir('.').srcnode().abspath |
21 |
|
|
filenames = os.listdir(src_dir) |
22 |
gross |
700 |
# |
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 |
ksteube |
1705 |
testruns = [] |
34 |
|
|
testruns += ['run_escriptOnFinley.py'] |
35 |
|
|
testruns += ['run_generators.py'] |
36 |
ksteube |
1754 |
testruns += ['run_inputOutput.py'] |
37 |
phornby |
1894 |
testruns += ['run_linearPDEsOnFinley1.py'] |
38 |
|
|
testruns += ['run_linearPDEsOnFinley2.py'] |
39 |
|
|
testruns += ['run_linearPDEsOnFinley3.py'] |
40 |
ksteube |
1705 |
testruns += ['run_models.py'] |
41 |
|
|
testruns += ['run_simplesolve.py'] |
42 |
|
|
testruns += ['run_utilOnFinley.py'] |
43 |
|
|
testruns += ['run_visualization_interface.py'] |
44 |
gross |
700 |
# |
45 |
|
|
# files defining tests run locally (not as part of a release) |
46 |
|
|
# |
47 |
|
|
localtestruns = [x for x in filenames if not x.startswith('run_') and os.path.splitext(x)[1] in ['.py']] |
48 |
|
|
# |
49 |
|
|
# all test |
50 |
|
|
# |
51 |
|
|
alltestruns = testruns + localtestruns |
52 |
|
|
# |
53 |
|
|
# test files are just compiled: |
54 |
|
|
# |
55 |
gross |
706 |
test_pyc = env.PyCompile(testfiles) |
56 |
|
|
env.Alias('build_py_tests',test_pyc) |
57 |
robwdcock |
661 |
|
58 |
|
|
#Add Unit Test to target alias |
59 |
gross |
706 |
local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/finley/test/python'))) |
60 |
gross |
705 |
local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/escript/test/python'))) |
61 |
gross |
709 |
local_env['ENV']['FINLEY_TEST_DATA']=env.Dir('#/finley/test/python').srcnode().abspath |
62 |
|
|
local_env['ENV']['FINLEY_WORKDIR']=env.Dir('#/build/$PLATFORM/finley/test/python').srcnode().abspath |
63 |
gross |
700 |
env.Alias('local_py_tests',[os.path.splitext(x)[0]+'.passed' for x in alltestruns]) |
64 |
|
|
env.Alias('py_tests', [os.path.splitext(x)[0]+'.passed' for x in testruns ]) |
65 |
robwdcock |
661 |
|
66 |
woo409 |
757 |
# |
67 |
|
|
# run all tests: |
68 |
|
|
# |
69 |
|
|
program = local_env.RunPyUnitTest(alltestruns) |
70 |
|
|
|
71 |
ksteube |
1705 |
Depends(program, local_env['pyinstall']) |
72 |
woo409 |
757 |
Depends(program, dep_lib) |
73 |
|
|
Depends(program, 'build_py_tests') |