1 |
jgs |
235 |
# Scons configuration file for DataConstant unit tests |
2 |
jgs |
196 |
|
3 |
|
|
import os |
4 |
jgs |
235 |
import sys |
5 |
jgs |
196 |
|
6 |
jgs |
235 |
# |
7 |
|
|
# ensure correct versions of python and scons |
8 |
jgs |
196 |
|
9 |
jgs |
235 |
EnsurePythonVersion(2,3) |
10 |
|
|
EnsureSConsVersion(0,96) |
11 |
jgs |
196 |
|
12 |
jgs |
235 |
# |
13 |
|
|
# set appropriate defaults for configuration variables |
14 |
jgs |
196 |
|
15 |
jgs |
235 |
esysroot = Dir('#../../..') |
16 |
|
|
usegcc = 0 |
17 |
jgs |
196 |
|
18 |
jgs |
235 |
# |
19 |
|
|
# retreive command-line arguments if any |
20 |
jgs |
196 |
|
21 |
jgs |
235 |
if ARGUMENTS.get('usegcc',0): |
22 |
|
|
usegcc = 1 |
23 |
jgs |
196 |
|
24 |
jgs |
235 |
# |
25 |
|
|
# determine platform |
26 |
|
|
|
27 |
|
|
env = Environment(ENV = os.environ) |
28 |
|
|
platform = env['PLATFORM'] |
29 |
|
|
|
30 |
|
|
# |
31 |
|
|
# determine hostname |
32 |
|
|
|
33 |
|
|
hostname = os.environ['HOSTNAME'] |
34 |
|
|
|
35 |
|
|
# |
36 |
|
|
# load configuration settings |
37 |
|
|
|
38 |
|
|
options_dir = str(esysroot) + '/scons' |
39 |
|
|
sys.path.append(options_dir) |
40 |
|
|
|
41 |
|
|
if hostname=='ess': |
42 |
|
|
from ess_options import * |
43 |
|
|
|
44 |
|
|
cxx_flags=cxx_flags_debug |
45 |
|
|
|
46 |
|
|
# |
47 |
|
|
# print out build configuration for this module |
48 |
|
|
|
49 |
|
|
print "########################################################" |
50 |
|
|
print "Build configuration for module: DataConstant 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 |
jgs |
196 |
dataconstant_test_path = str(esysroot) + '/escript/test/DataConstant' |
62 |
|
|
escript_path = str(esysroot) + '/escript/inc' |
63 |
|
|
esysUtils_path = str(esysroot) + '/esysUtils/inc' |
64 |
|
|
CppUnitTest_path = str(esysroot) + '/tools/CppUnitTest/inc' |
65 |
|
|
|
66 |
|
|
esys_lib_path = str(esysroot) + '/lib' |
67 |
|
|
esysUtils_lib_path = str(esysroot) + '/esysUtils/lib' |
68 |
|
|
CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib' |
69 |
|
|
|
70 |
|
|
cpp_path = [dataconstant_test_path, |
71 |
|
|
escript_path, |
72 |
|
|
esysUtils_path, |
73 |
|
|
CppUnitTest_path, |
74 |
|
|
python_path, |
75 |
|
|
boost_path] |
76 |
|
|
|
77 |
|
|
lib_path = [esys_lib_path, |
78 |
|
|
esysUtils_lib_path, |
79 |
|
|
CppUnitTest_lib_path, |
80 |
|
|
python_lib_path, |
81 |
|
|
boost_lib_path] |
82 |
|
|
|
83 |
|
|
libs = ['escriptcpp', |
84 |
|
|
'esysUtils', |
85 |
|
|
'CppUnitTest', |
86 |
|
|
'python2.3', |
87 |
|
|
'boost_python-intel-d-1_31', |
88 |
|
|
'dl', |
89 |
|
|
'util', |
90 |
|
|
'guide', |
91 |
|
|
'irc'] |
92 |
|
|
|
93 |
|
|
sources = ['DataConstantTestCase.cpp', |
94 |
|
|
'DataConstantTest.cpp'] |
95 |
|
|
|
96 |
|
|
target = 'DataConstantTest.exe' |
97 |
|
|
|
98 |
|
|
dataconstant_env = Environment(ENV = os.environ) |
99 |
|
|
|
100 |
jgs |
235 |
dataconstant_env.Replace(CXX = cxx) |
101 |
jgs |
196 |
dataconstant_env.Replace(CXXFLAGS = cxx_flags) |
102 |
|
|
dataconstant_env.Replace(CPPPATH = cpp_path) |
103 |
|
|
dataconstant_env.Replace(LIBPATH = lib_path) |
104 |
|
|
dataconstant_env.Replace(LIBS = libs) |
105 |
|
|
|
106 |
|
|
dataconstant_test_exe = dataconstant_env.Program(target, sources) |