12
12
########################################################
18
local_env = clone_env(env_mpi)
20
src_dir = local_env.Dir('.').srcnode().abspath
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"] ]
26
sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]
28
local_env.Append(LIBS= ['escript', 'esysUtils', 'CppUnitTest'] + local_env['sys_libs'] )
29
local_env['CCFLAGS'] = re.sub("-O[0-9]", "-g", str(local_env['CCFLAGS'])) # Some of these test files are too large to optimize
31
program = local_env.Program('escript_UnitTest', sources)
33
#Add Unit Test to target alias
35
local_env.Alias('build_tests', program)
16
local_env = env.Clone()
18
# get the test source file names
19
sources = Glob('*.cpp')+Glob('*.c')
20
testname='escript_UnitTest'
22
# build the executable
23
local_env.Append(LIBS=['escript', 'esysUtils', 'CppUnitTest'])
24
# some of these test files are too large to optimize
25
local_env['CCFLAGS'] = re.sub('-O[0-9]', '-g', str(local_env['CCFLAGS']))
26
program = local_env.Program(testname, sources)
37
28
# run the tests - but only if test_targets are stale
38
local_env.RunUnitTest('escript_UnitTest')
39
test_targets = os.path.splitext('escript_UnitTest')[0]+'.passed'
40
Alias("run_tests", test_targets)
42
# Add a group of tests
29
local_env.RunUnitTest(testname)
31
# add unit test to target alias
32
Alias('build_tests', program)
33
Alias("run_tests", testname+'.passed')
35
# configure python unit tests
36
local_env.SConscript(dirs = ['#/escript/test/python'], variant_dir='python', duplicate=0, exports=['py_wrapper_lib'])
38
# add a group of tests
43
39
from grouptest import *
44
tgroup=GroupTest("$BINRUNNER ", (),"","$BUILD_DIR/escript/test",('./escript_UnitTest',))
40
tgroup=GroupTest("$BINRUNNER ", (), "", "$BUILD_DIR/escript/test", ('./'+testname,))
45
41
TestGroups.append(tgroup)
47
CallSConscript(local_env,dirs = ['#/escript/test/python'], variant_dir='python', duplicate=0)