~vcs-imports/escript-finley/trunk

« back to all changes in this revision

Viewing changes to finley/test/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
16
14
Import('*')
17
 
 
18
 
local_env = clone_env(env_mpi)
19
 
 
20
 
# get the relevant file names:
21
 
src_dir = local_env.Dir('.').srcnode().abspath
22
 
filenames = [ x for x in os.listdir(src_dir) if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]
23
 
 
24
 
sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]
25
 
 
26
 
local_env.Append(LIBS=['finley', 'escript', 'paso', 'esysUtils', 'CppUnitTest'] + env['sys_libs'])
27
 
 
28
 
# compile test
29
 
program = local_env.Program('finley_UnitTest', sources)
30
 
env.Alias('build_tests', program)
 
15
local_env = env.Clone()
 
16
 
 
17
# get the test source file names
 
18
sources = Glob('*.cpp')+Glob('*.c')
 
19
testname='finley_UnitTest'
 
20
 
 
21
# build the executable
 
22
local_env.Append(LIBS=['finley', 'escript', 'paso', 'esysUtils', 'CppUnitTest'])
 
23
program = local_env.Program(testname, sources)
31
24
 
32
25
# run the tests - but only if test_targets are stale
33
 
local_env.RunUnitTest('finley_UnitTest')
34
 
test_targets = os.path.splitext('finley_UnitTest')[0]+'.passed'
35
 
Alias("run_tests", test_targets)
36
 
 
37
 
CallSConscript(local_env,dirs = ['#/finley/test/python'], variant_dir='python', duplicate=0)
38
 
 
39
 
# Add a group of tests
 
26
local_env.RunUnitTest(testname)
 
27
 
 
28
# add unit test to target alias
 
29
Alias('build_tests', program)
 
30
Alias("run_tests", testname+'.passed')
 
31
 
 
32
# configure python unit tests
 
33
local_env.SConscript(dirs = ['#/finley/test/python'], variant_dir='python', duplicate=0, exports=['py_wrapper_lib'])
 
34
 
 
35
# add a group of tests
40
36
from grouptest import *
41
 
tgroup=GroupTest("$BINRUNNER ", (),"","$BUILD_DIR/finley/test",('./finley_UnitTest',))
 
37
tgroup=GroupTest("$BINRUNNER ", (), "", "$BUILD_DIR/finley/test", ('./'+testname,))
42
38
TestGroups.append(tgroup)
 
39