1 |
# Scons configuration file for esysUtils unit tests |
2 |
|
3 |
import os |
4 |
import sys |
5 |
|
6 |
# ensure correct versions of python and scons |
7 |
|
8 |
EnsurePythonVersion(2,3) |
9 |
EnsureSConsVersion(0,96) |
10 |
|
11 |
# |
12 |
# set appropriate defaults for configuration variables |
13 |
|
14 |
esysroot = Dir('#../../..') |
15 |
usegcc = 0 |
16 |
|
17 |
# |
18 |
# retreive command-line arguments if any |
19 |
|
20 |
if ARGUMENTS.get('usegcc',0): |
21 |
usegcc = 1 |
22 |
|
23 |
# |
24 |
# determine platform |
25 |
|
26 |
env = Environment(ENV = os.environ) |
27 |
platform = env['PLATFORM'] |
28 |
|
29 |
# |
30 |
# determine hostname |
31 |
|
32 |
hostname = os.environ['HOSTNAME'] |
33 |
|
34 |
# |
35 |
# load configuration settings |
36 |
|
37 |
options_dir = str(esysroot) + '/scons' |
38 |
sys.path.append(options_dir) |
39 |
|
40 |
if hostname=='ess': |
41 |
from ess_options import * |
42 |
|
43 |
cxx_flags=cxx_flags_debug |
44 |
|
45 |
# |
46 |
# print out build configuration for this module |
47 |
|
48 |
print "####################################################" |
49 |
print "Build configuration for module: Bruce unit tests" |
50 |
print "Build configuration for module: Bruce unit tests" |
51 |
print " dodebug: 1" |
52 |
print " usegcc: ", usegcc |
53 |
print " cxx: ", cxx |
54 |
print " platform: ", platform |
55 |
print " hostname: ", hostname |
56 |
print "####################################################" |
57 |
|
58 |
# |
59 |
# do the actual build |
60 |
|
61 |
esysexception_test_path = str(esysroot) + '/esysUtils/test/EsysException' |
62 |
esysUtils_path = str(esysroot) + '/esysUtils/inc' |
63 |
CppUnitTest_path = str(esysroot) + '/tools/CppUnitTest/inc' |
64 |
|
65 |
esysUtils_lib_path = str(esysroot) + '/esysUtils/lib' |
66 |
CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib' |
67 |
|
68 |
cpp_path = [esysexception_test_path, |
69 |
esysUtils_path, |
70 |
CppUnitTest_path] |
71 |
|
72 |
lib_path = [esysUtils_lib_path, |
73 |
CppUnitTest_lib_path] |
74 |
|
75 |
libs = ['esysUtils', |
76 |
'CppUnitTest', |
77 |
'guide', |
78 |
'irc'] |
79 |
|
80 |
sources = ['EsysExceptionTestCase.cpp', |
81 |
'EsysExceptionTest.cpp'] |
82 |
|
83 |
target = 'EsysExceptionTest.exe' |
84 |
|
85 |
esysexception_env = Environment(ENV = os.environ) |
86 |
|
87 |
esysexception_env.Replace(CXX = cxx) |
88 |
esysexception_env.Replace(CXXFLAGS = cxx_flags) |
89 |
esysexception_env.Replace(CPPPATH = cpp_path) |
90 |
esysexception_env.Replace(LIBPATH = lib_path) |
91 |
esysexception_env.Replace(LIBS = libs) |
92 |
|
93 |
esysexception_test_exe = esysexception_env.Program(target, sources) |