1 |
Import('*') |
2 |
# FIXME: This whole test should be refactored into the directory above as esysUtils_UnitTest so it is the same as the other modules |
3 |
|
4 |
program_name = 'EsysExceptionTest' |
5 |
|
6 |
local_env=env.Copy() |
7 |
|
8 |
local_env.Append(LIBS=['esysUtils', 'CppUnitTest', sys_libs]) |
9 |
|
10 |
src_dir = local_env.Dir('.').srcnode().abspath |
11 |
|
12 |
import os |
13 |
filenames = os.listdir(src_dir) |
14 |
sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']] |
15 |
|
16 |
local_env.Append(CPPPATH = ['#/tools/CppUnitTest/inc',]) |
17 |
|
18 |
program = local_env.Program(program_name, sources) |
19 |
|
20 |
Depends(program, dep_lib) |
21 |
|
22 |
# TODO: Need to decide on how the library paths etc are going to be handled |
23 |
# TODO: For now just install the program to the same location as the libraries so things can run at least |
24 |
test_install = local_env.Install(libinstall, program) |
25 |
|
26 |
#Add Unit Test to target alias |
27 |
|
28 |
env.Alias('build_tests', test_install) |
29 |
|
30 |
# run the tests - but only if test_targets are stale |
31 |
local_env.RunUnitTest(program_name) |
32 |
test_targets = os.path.splitext(program_name)[0]+'.passed' |
33 |
Alias("run_tests", test_targets) |