~vcs-imports/escript-finley/trunk

« back to all changes in this revision

Viewing changes to finley/test/python/SConscript

  • Committer: jfenwick
  • Date: 2010-10-11 01:48:14 UTC
  • Revision ID: svn-v4:77569008-7704-0410-b7a0-a92fef0b09fd:trunk:3259
Merging dudley and scons updates from branches

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
#
12
12
########################################################
13
13
 
14
 
 
15
 
import os
 
14
from os.path import splitext
16
15
Import('*')
17
16
 
18
 
local_env = clone_env(env)
 
17
local_env = env.Clone()
19
18
 
20
 
src_dir = local_env.Dir('.').srcnode().abspath
21
 
filenames = os.listdir(src_dir)
22
 
#
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
 
 
19
# files defining test runs (passing in a release)
33
20
testruns = []
34
21
testruns += ['run_escriptOnFinley.py']
35
22
testruns += ['run_generators.py']
42
29
testruns += ['run_simplesolve.py']
43
30
testruns += ['run_utilOnFinley.py']
44
31
testruns += ['run_visualization_interface.py']
45
 
 
32
 
46
33
#  files defining a few tests for a quick test
47
 
48
34
scalable_tests = []
49
35
scalable_tests += ['run_inputOutput.py']
50
36
scalable_tests += ['run_simplesolve.py']
51
 
#
 
37
 
52
38
# files defining tests run locally (not as part of a release)
53
 
#
54
 
localtestruns = [x for x in filenames if not x.startswith('run_') and os.path.splitext(x)[1] in ['.py']]
55
 
#
56
 
# all test 
57
 
#
 
39
localtestruns = [x for x in Glob('*.py', strings=True) if not x.startswith('run_')]
 
40
 
 
41
# all tests
58
42
alltestruns = testruns + localtestruns
59
 
#
60
 
# test files are just compiled:
61
 
#
62
 
test_pyc = env.PyCompile(testfiles)
63
 
env.Alias('build_py_tests',test_pyc)
64
 
 
65
 
#Add Unit Test to target alias
 
43
 
 
44
# test files are just compiled - none of those in finley yet
 
45
#sources = Glob('test_*.py')
 
46
#test_pyc = env.PyCompile(sources)
 
47
#env.Alias('build_py_tests', test_pyc)
 
48
 
 
49
# add unit test to target alias
66
50
local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/finley/test/python')))
67
51
local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/escript/test/python')))
68
52
local_env['ENV']['FINLEY_TEST_DATA']=env.Dir('#/finley/test/python').srcnode().abspath
69
53
local_env['ENV']['FINLEY_WORKDIR']=env.Dir('#/build/$PLATFORM/finley/test/python').srcnode().abspath
70
 
env.Alias('local_py_tests',[os.path.splitext(x)[0]+'.passed' for x in alltestruns])
71
 
env.Alias('py_tests', [os.path.splitext(x)[0]+'.passed' for x in testruns ])
72
 
env.Alias('scalable_tests', [os.path.splitext(x)[0]+'.passed' for x in scalable_tests ])
 
54
env.Alias('local_py_tests',[splitext(x)[0]+'.passed' for x in alltestruns])
 
55
env.Alias('py_tests', [splitext(x)[0]+'.passed' for x in testruns ])
 
56
env.Alias('scalable_tests', [splitext(x)[0]+'.passed' for x in scalable_tests])
73
57
 
74
 
#
75
 
# run all tests:
76
 
#
 
58
# run all tests
77
59
program = local_env.RunPyUnitTest(alltestruns)
 
60
Depends(program, py_wrapper_lib)
78
61
 
79
 
# Add a group of tests
 
62
# add a group of tests
80
63
from grouptest import *
81
64
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)
82
65
tgroup.makeDir("$BUILD_DIR/finley/test/python")
83
66
TestGroups.append(tgroup)
84
67
 
85
 
Depends(program, local_env['pyinstall'])
86
 
Depends(program, dep_lib) 
87
 
Depends(program, 'build_py_tests')