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