1 |
robwdcock |
649 |
Import('*') |
2 |
|
|
|
3 |
|
|
program_name = 'finley_UnitTest' |
4 |
|
|
|
5 |
|
|
local_env=env.Copy() |
6 |
|
|
|
7 |
|
|
|
8 |
|
|
src_dir = local_env.Dir('.').srcnode().abspath |
9 |
|
|
|
10 |
|
|
import os |
11 |
|
|
filenames = os.listdir(src_dir) |
12 |
|
|
sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']] |
13 |
|
|
|
14 |
robwdcock |
666 |
local_env.Append(LIBS=[ python_lib, boost_lib, 'paso', 'esysUtils', 'CppUnitTest', scsl_libs, mkl_libs, umf_libs, sys_libs]) |
15 |
|
|
|
16 |
|
|
local_env.sharedLinkHack(['finleycpp', 'escriptcpp',], libinstall, sources) |
17 |
|
|
|
18 |
|
|
|
19 |
robwdcock |
649 |
program = local_env.Program(program_name, sources) |
20 |
|
|
|
21 |
|
|
Depends(program, dep_lib) |
22 |
|
|
|
23 |
|
|
# TODO: Need to decide on how the library paths etc are going to be handled |
24 |
|
|
# TODO: For now just install the program to the same location as the libraries so things can run at least |
25 |
|
|
test_install = local_env.Install(libinstall, program) |
26 |
|
|
|
27 |
|
|
#Add Unit Test to target alias |
28 |
|
|
|
29 |
|
|
env.Alias('build_tests', test_install) |
30 |
|
|
|
31 |
|
|
# run the tests - but only if test_targets are stale |
32 |
|
|
local_env.RunUnitTest(program_name) |
33 |
|
|
test_targets = os.path.splitext(program_name)[0]+'.passed' |
34 |
|
|
Alias("run_tests", test_targets) |
35 |
|
|
|
36 |
robwdcock |
661 |
local_env.SConscript(dirs = ['#/finley/test/python'], build_dir='python', duplicate=0) |