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