1 |
jgs |
235 |
# Scons configuration file for DataConstant unit tests |
2 |
jgs |
455 |
|
3 |
|
|
# |
4 |
|
|
# set appropriate defaults for configuration variables |
5 |
|
|
|
6 |
gross |
425 |
esysroot=str(Dir('./../../../..').abspath) |
7 |
|
|
execfile(str(File(esysroot+"/scons/esys_options.py"))) |
8 |
jgs |
455 |
|
9 |
jgs |
235 |
cxx_flags=cxx_flags_debug |
10 |
jgs |
455 |
|
11 |
jgs |
235 |
print "Build configuration for module: DataConstant unit tests" |
12 |
|
|
print " cxx: ", cxx |
13 |
gross |
425 |
print " cxx_flags: ", cxx_flags |
14 |
jgs |
235 |
|
15 |
|
|
# |
16 |
|
|
# do the actual build |
17 |
|
|
|
18 |
jgs |
196 |
dataconstant_test_path = str(esysroot) + '/escript/test/DataConstant' |
19 |
jgs |
474 |
escript_path = str(esysroot) + '/escript/src' |
20 |
jgs |
468 |
esysUtils_path = str(esysroot) + '/esysUtils/src' |
21 |
jgs |
196 |
CppUnitTest_path = str(esysroot) + '/tools/CppUnitTest/inc' |
22 |
|
|
|
23 |
|
|
esys_lib_path = str(esysroot) + '/lib' |
24 |
|
|
esysUtils_lib_path = str(esysroot) + '/esysUtils/lib' |
25 |
|
|
CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib' |
26 |
|
|
|
27 |
jgs |
288 |
escript_lib = str(esys_lib_path) + '/libescriptcpp.so' |
28 |
|
|
|
29 |
|
|
install_dir = str(esysroot) + '/escript/test' |
30 |
|
|
|
31 |
jgs |
196 |
cpp_path = [dataconstant_test_path, |
32 |
|
|
escript_path, |
33 |
|
|
esysUtils_path, |
34 |
|
|
CppUnitTest_path, |
35 |
|
|
python_path, |
36 |
|
|
boost_path] |
37 |
|
|
|
38 |
|
|
lib_path = [esys_lib_path, |
39 |
|
|
esysUtils_lib_path, |
40 |
|
|
CppUnitTest_lib_path, |
41 |
|
|
python_lib_path, |
42 |
|
|
boost_lib_path] |
43 |
|
|
|
44 |
|
|
libs = ['escriptcpp', |
45 |
|
|
'esysUtils', |
46 |
|
|
'CppUnitTest', |
47 |
jgs |
239 |
str(python_lib), |
48 |
|
|
str(boost_lib), |
49 |
jgs |
196 |
'dl', |
50 |
jgs |
252 |
'util'] |
51 |
jgs |
196 |
|
52 |
jgs |
252 |
libs.extend(sys_libs) |
53 |
|
|
|
54 |
jgs |
196 |
sources = ['DataConstantTestCase.cpp', |
55 |
|
|
'DataConstantTest.cpp'] |
56 |
|
|
|
57 |
|
|
target = 'DataConstantTest.exe' |
58 |
|
|
|
59 |
gross |
425 |
import os |
60 |
jgs |
196 |
dataconstant_env = Environment(ENV = os.environ) |
61 |
|
|
|
62 |
jgs |
235 |
dataconstant_env.Replace(CXX = cxx) |
63 |
jgs |
196 |
dataconstant_env.Replace(CXXFLAGS = cxx_flags) |
64 |
|
|
dataconstant_env.Replace(CPPPATH = cpp_path) |
65 |
|
|
dataconstant_env.Replace(LIBPATH = lib_path) |
66 |
|
|
dataconstant_env.Replace(LIBS = libs) |
67 |
|
|
|
68 |
|
|
dataconstant_test_exe = dataconstant_env.Program(target, sources) |
69 |
jgs |
288 |
|
70 |
|
|
Depends(dataconstant_test_exe, escript_lib) |
71 |
|
|
|
72 |
jgs |
355 |
Alias("build_tests", dataconstant_env.Install(install_dir, dataconstant_test_exe)) |
73 |
jgs |
360 |
|
74 |
|
|
import scons_extensions |
75 |
|
|
runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', single_source=True) |
76 |
|
|
dataconstant_env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder}); |
77 |
|
|
|
78 |
|
|
Alias("run_tests", dataconstant_env.RunUnitTest(target)) |