1 |
# Scons configuration file for finley MeshAdapter unit tests |
2 |
|
3 |
# |
4 |
# set appropriate configuration variable defaults |
5 |
esysroot=str(Dir('./../../../../').abspath) |
6 |
execfile(str(File(esysroot+"/scons/esys_options.py"))) |
7 |
|
8 |
cxx_flags=cxx_flags_debug |
9 |
|
10 |
print "Build configuration for module: MeshAdapter unit tests" |
11 |
print " cxx: ", cxx |
12 |
print " cxx_flags: ", cxx_flags |
13 |
|
14 |
# |
15 |
# do the actual build |
16 |
|
17 |
meshadapter_test_path = str(esysroot) + '/finley/test/MeshAdapter' |
18 |
escript_path = str(esysroot) + '/escript/inc' |
19 |
finley_path = str(esysroot) + '/finley/src/finley' |
20 |
finley_cppadapter_path = str(esysroot) + '/finley/src/finley/CPPAdapter' |
21 |
paso_path = str(esysroot) + '/paso/src' |
22 |
mmio_path = str(esysroot) + '/tools/mmio/inc' |
23 |
esysUtils_path = str(esysroot) + '/esysUtils/inc' |
24 |
CppUnitTest_path = str(esysroot) + '/tools/CppUnitTest/inc' |
25 |
|
26 |
esys_lib_path = str(esysroot) + '/lib' |
27 |
finley_lib_path = str(esysroot) + '/finley/lib' |
28 |
mmio_lib_path = str(esysroot) + '/tools/mmio/lib' |
29 |
esysUtils_lib_path = str(esysroot) + '/esysUtils/lib' |
30 |
CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib' |
31 |
|
32 |
finley_lib = str(esys_lib_path) + '/libfinleycpp.so' |
33 |
|
34 |
install_dir = str(esysroot) + '/finley/test' |
35 |
|
36 |
cpp_path = [meshadapter_test_path, |
37 |
escript_path, |
38 |
finley_path, |
39 |
finley_cppadapter_path, |
40 |
paso_path, |
41 |
mmio_path, |
42 |
esysUtils_path, |
43 |
CppUnitTest_path, |
44 |
python_path, |
45 |
boost_path] |
46 |
|
47 |
lib_path = [esys_lib_path, |
48 |
finley_lib_path, |
49 |
mmio_lib_path, |
50 |
esysUtils_lib_path, |
51 |
CppUnitTest_lib_path, |
52 |
python_lib_path, |
53 |
boost_lib_path] |
54 |
|
55 |
libs = ['escriptcpp', |
56 |
'esysUtils', |
57 |
'finleycpp', |
58 |
'paso', |
59 |
'mmio', |
60 |
'CppUnitTest', |
61 |
str(python_lib), |
62 |
str(boost_lib), |
63 |
'dl', |
64 |
'util'] |
65 |
|
66 |
libs.extend(sys_libs) |
67 |
libs.extend(solver_libs) |
68 |
|
69 |
sources = ['MeshAdapterTestCase.cpp', |
70 |
'MeshAdapterTest.cpp'] |
71 |
|
72 |
target = 'MeshAdapterTest.exe' |
73 |
|
74 |
import os |
75 |
meshadapter_env = Environment(ENV = os.environ) |
76 |
|
77 |
meshadapter_env.Replace(CXX = cxx) |
78 |
meshadapter_env.Replace(CXXFLAGS = cxx_flags) |
79 |
meshadapter_env.Replace(CPPPATH = cpp_path) |
80 |
meshadapter_env.Replace(LIBPATH = lib_path) |
81 |
meshadapter_env.Replace(LIBS = libs) |
82 |
|
83 |
meshadapter_test_exe = meshadapter_env.Program(target, sources) |
84 |
|
85 |
Depends(meshadapter_test_exe, finley_lib) |
86 |
|
87 |
Alias("build_tests", meshadapter_env.Install(install_dir, meshadapter_test_exe)) |
88 |
|
89 |
import scons_extensions |
90 |
runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', single_source=True) |
91 |
meshadapter_env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder}); |
92 |
|
93 |
Alias("run_tests", meshadapter_env.RunUnitTest(target)) |