1 |
jgs |
227 |
# Scons configuration file for esysUtils unit tests |
2 |
gross |
425 |
esysroot=str(Dir('./../../../..').abspath) |
3 |
|
|
execfile(str(File(esysroot+"/scons/esys_options.py"))) |
4 |
jgs |
197 |
|
5 |
jgs |
227 |
cxx_flags=cxx_flags_debug |
6 |
gross |
425 |
cc_flags=cc_flags_debug |
7 |
jgs |
227 |
|
8 |
|
|
# |
9 |
|
|
# print out build configuration for this module |
10 |
|
|
|
11 |
jgs |
246 |
print "Build configuration for module: EsysException unit tests" |
12 |
jgs |
227 |
print " cxx: ", cxx |
13 |
gross |
425 |
print " cxx_flags: ", cxx_flags |
14 |
jgs |
227 |
|
15 |
|
|
# |
16 |
|
|
# do the actual build |
17 |
|
|
|
18 |
jgs |
197 |
esysexception_test_path = str(esysroot) + '/esysUtils/test/EsysException' |
19 |
|
|
esysUtils_path = str(esysroot) + '/esysUtils/inc' |
20 |
|
|
CppUnitTest_path = str(esysroot) + '/tools/CppUnitTest/inc' |
21 |
|
|
|
22 |
|
|
esysUtils_lib_path = str(esysroot) + '/esysUtils/lib' |
23 |
|
|
CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib' |
24 |
|
|
|
25 |
jgs |
306 |
esysUtils_lib = str(esysUtils_lib_path) + '/libesysUtils.a' |
26 |
|
|
|
27 |
|
|
install_dir = str(esysroot) + '/esysUtils/test' |
28 |
|
|
|
29 |
jgs |
197 |
cpp_path = [esysexception_test_path, |
30 |
|
|
esysUtils_path, |
31 |
|
|
CppUnitTest_path] |
32 |
|
|
|
33 |
|
|
lib_path = [esysUtils_lib_path, |
34 |
|
|
CppUnitTest_lib_path] |
35 |
|
|
|
36 |
|
|
libs = ['esysUtils', |
37 |
jgs |
252 |
'CppUnitTest'] |
38 |
jgs |
197 |
|
39 |
jgs |
252 |
libs.extend(sys_libs) |
40 |
|
|
|
41 |
jgs |
197 |
sources = ['EsysExceptionTestCase.cpp', |
42 |
|
|
'EsysExceptionTest.cpp'] |
43 |
|
|
|
44 |
|
|
target = 'EsysExceptionTest.exe' |
45 |
|
|
|
46 |
gross |
425 |
import os |
47 |
jgs |
197 |
esysexception_env = Environment(ENV = os.environ) |
48 |
|
|
|
49 |
jgs |
227 |
esysexception_env.Replace(CXX = cxx) |
50 |
jgs |
197 |
esysexception_env.Replace(CXXFLAGS = cxx_flags) |
51 |
|
|
esysexception_env.Replace(CPPPATH = cpp_path) |
52 |
|
|
esysexception_env.Replace(LIBPATH = lib_path) |
53 |
|
|
esysexception_env.Replace(LIBS = libs) |
54 |
|
|
|
55 |
|
|
esysexception_test_exe = esysexception_env.Program(target, sources) |
56 |
jgs |
306 |
|
57 |
|
|
Depends(esysexception_test_exe, esysUtils_lib) |
58 |
|
|
|
59 |
jgs |
355 |
Alias("build_tests", esysexception_env.Install(install_dir, esysexception_test_exe)) |
60 |
jgs |
360 |
|
61 |
|
|
import scons_extensions |
62 |
|
|
runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', single_source=True) |
63 |
|
|
esysexception_env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder}); |
64 |
|
|
|
65 |
|
|
Alias("run_tests", esysexception_env.RunUnitTest(target)) |