~vcs-imports/escript-finley/trunk

« back to all changes in this revision

Viewing changes to esysUtils/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
 
src_dir = local_env.Dir('.').srcnode().abspath
21
 
 
22
 
# get the relevant file names:
23
 
src_dir = local_env.Dir('.').srcnode().abspath
24
 
filenames = [ x for x in os.listdir(src_dir) if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]
25
 
 
26
 
sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]
27
 
 
28
 
local_env.Append(LIBS=[ 'esysUtils', 'CppUnitTest', env['sys_libs']])
29
 
 
30
 
program = local_env.Program('EsysExceptionTest', sources)
31
 
 
32
 
#Add Unit Test to target alias
33
 
 
34
 
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='EsysExceptionTest'
 
20
 
 
21
# build the executable
 
22
local_env.Append(LIBS=['esysUtils', 'CppUnitTest'])
 
23
program = local_env.Program(testname, sources)
35
24
 
36
25
# run the tests - but only if test_targets are stale
37
 
local_env.RunUnitTest('EsysExceptionTest')
38
 
test_targets = os.path.splitext('EsysExceptionTest')[0]+'.passed'
39
 
Alias("run_tests", test_targets)
40
 
 
41
 
# 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
# add a group of tests
42
33
from grouptest import *
43
 
tgroup=GroupTest("$BINRUNNER ", (),"","$BUILD_DIR/esysUtils/test",('./EsysExceptionTest',))
 
34
tgroup=GroupTest("$BINRUNNER ", (), "", "$BUILD_DIR/esysUtils/test", ('./'+testname,))
44
35
TestGroups.append(tgroup)
45
36