/[escript]/trunk/esysUtils/test/SConscript
ViewVC logotype

Annotation of /trunk/esysUtils/test/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 334 - (hide annotations)
Thu Dec 8 22:52:12 2005 UTC (13 years, 10 months ago) by jgs
Original Path: trunk/esysUtils/test/EsysException/SConscript
File size: 2538 byte(s)
use socket.gethostname() to get host name

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 252 sys_libs = []
18 jgs 197
19 jgs 227 #
20 jgs 248 # import configuration variables passed in from
21     # calling SConscript (if any)
22    
23     Import('*')
24    
25     #
26 jgs 227 # retreive command-line arguments if any
27    
28     if ARGUMENTS.get('usegcc',0):
29     usegcc = 1
30    
31 jgs 246 if ARGUMENTS.get('options',0):
32     options = ARGUMENTS.get('options',0)
33    
34 jgs 227 #
35     # determine platform
36    
37     env = Environment(ENV = os.environ)
38     platform = env['PLATFORM']
39    
40     #
41     # determine hostname
42    
43 jgs 334 import socket
44     hostname = socket.gethostname()
45 jgs 227
46     #
47     # load configuration settings
48    
49     options_dir = str(esysroot) + '/scons'
50     sys.path.append(options_dir)
51    
52 jgs 306 from default_options import *
53    
54 jgs 227 if hostname=='ess':
55     from ess_options import *
56    
57 jgs 241 if usegcc==1:
58     from gcc_options import *
59    
60 jgs 246 if options!=None:
61     exec "from " + options + " import *"
62    
63 jgs 227 cxx_flags=cxx_flags_debug
64    
65     #
66     # print out build configuration for this module
67    
68 jgs 246 print "Build configuration for module: EsysException unit tests"
69 jgs 227 print " dodebug: 1"
70     print " usegcc: ", usegcc
71     print " cxx: ", cxx
72     print " platform: ", platform
73     print " hostname: ", hostname
74    
75     #
76     # do the actual build
77    
78 jgs 197 esysexception_test_path = str(esysroot) + '/esysUtils/test/EsysException'
79     esysUtils_path = str(esysroot) + '/esysUtils/inc'
80     CppUnitTest_path = str(esysroot) + '/tools/CppUnitTest/inc'
81    
82     esysUtils_lib_path = str(esysroot) + '/esysUtils/lib'
83     CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib'
84    
85 jgs 306 esysUtils_lib = str(esysUtils_lib_path) + '/libesysUtils.a'
86    
87     install_dir = str(esysroot) + '/esysUtils/test'
88    
89 jgs 197 cpp_path = [esysexception_test_path,
90     esysUtils_path,
91     CppUnitTest_path]
92    
93     lib_path = [esysUtils_lib_path,
94     CppUnitTest_lib_path]
95    
96     libs = ['esysUtils',
97 jgs 252 'CppUnitTest']
98 jgs 197
99 jgs 252 libs.extend(sys_libs)
100    
101 jgs 197 sources = ['EsysExceptionTestCase.cpp',
102     'EsysExceptionTest.cpp']
103    
104     target = 'EsysExceptionTest.exe'
105    
106     esysexception_env = Environment(ENV = os.environ)
107    
108 jgs 227 esysexception_env.Replace(CXX = cxx)
109 jgs 197 esysexception_env.Replace(CXXFLAGS = cxx_flags)
110     esysexception_env.Replace(CPPPATH = cpp_path)
111     esysexception_env.Replace(LIBPATH = lib_path)
112     esysexception_env.Replace(LIBS = libs)
113    
114     esysexception_test_exe = esysexception_env.Program(target, sources)
115 jgs 306
116     Depends(esysexception_test_exe, esysUtils_lib)
117    
118     esysexception_env.Install(install_dir, esysexception_test_exe)

  ViewVC Help
Powered by ViewVC 1.1.26