/[escript]/branches/arrayview_from_1695_trunk/esysUtils/test/SConscript
ViewVC logotype

Diff of /branches/arrayview_from_1695_trunk/esysUtils/test/SConscript

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 197 by jgs, Tue Nov 22 02:01:35 2005 UTC revision 306 by jgs, Mon Dec 5 00:48:01 2005 UTC
# Line 1  Line 1 
1  esysroot = None  # 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    options = None
17    sys_libs = []
18    
19    #
20    # import configuration variables passed in from
21    # calling SConscript (if any)
22    
23  Import('*')  Import('*')
24    
25  import os  #
26  import string  # retreive command-line arguments if any
27    
28    if ARGUMENTS.get('usegcc',0):
29      usegcc = 1
30    
31    if ARGUMENTS.get('options',0):
32      options = ARGUMENTS.get('options',0)
33    
34    #
35    # determine platform
36    
37    env = Environment(ENV = os.environ)
38    platform = env['PLATFORM']
39    
40    #
41    # determine hostname
42    
43  if esysroot == None:  hostname = os.environ['HOSTNAME']
   esysroot = Dir('#../../..')  
44    
45  ##### these will enventually be loaded from an external config file ########  #
46    # load configuration settings
47    
48  cxx_flags = '-O0 -openmp -openmp_report0 -tpp2 -ansi -ansi_alias -no-gcc -fpic -w1'  options_dir = str(esysroot) + '/scons'
49    sys.path.append(options_dir)
50    
51  ############################################################################  from default_options import *
52    
53    if hostname=='ess':
54      from ess_options import *
55    
56    if usegcc==1:
57      from gcc_options import *
58    
59    if options!=None:
60      exec "from " + options + " import *"
61    
62    cxx_flags=cxx_flags_debug
63    
64    #
65    # print out build configuration for this module
66    
67    print "Build configuration for module: EsysException unit tests"
68    print "         dodebug:  1"
69    print "          usegcc: ", usegcc
70    print "             cxx: ", cxx
71    print "        platform: ", platform
72    print "        hostname: ", hostname
73    
74    #
75    # do the actual build
76    
77  esysexception_test_path = str(esysroot) + '/esysUtils/test/EsysException'  esysexception_test_path = str(esysroot) + '/esysUtils/test/EsysException'
78  esysUtils_path = str(esysroot) + '/esysUtils/inc'  esysUtils_path = str(esysroot) + '/esysUtils/inc'
# Line 21  CppUnitTest_path = str(esysroot) + '/too Line 81  CppUnitTest_path = str(esysroot) + '/too
81  esysUtils_lib_path = str(esysroot) + '/esysUtils/lib'  esysUtils_lib_path = str(esysroot) + '/esysUtils/lib'
82  CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib'  CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib'
83    
84    esysUtils_lib = str(esysUtils_lib_path) + '/libesysUtils.a'
85    
86    install_dir = str(esysroot) + '/esysUtils/test'
87    
88  cpp_path = [esysexception_test_path,  cpp_path = [esysexception_test_path,
89              esysUtils_path,              esysUtils_path,
90              CppUnitTest_path]              CppUnitTest_path]
# Line 29  lib_path = [esysUtils_lib_path, Line 93  lib_path = [esysUtils_lib_path,
93              CppUnitTest_lib_path]              CppUnitTest_lib_path]
94    
95  libs = ['esysUtils',  libs = ['esysUtils',
96          'CppUnitTest',          'CppUnitTest']
97          'guide',  
98          'irc']  libs.extend(sys_libs)
99    
100  sources = ['EsysExceptionTestCase.cpp',  sources = ['EsysExceptionTestCase.cpp',
101             'EsysExceptionTest.cpp']             'EsysExceptionTest.cpp']
# Line 40  target = 'EsysExceptionTest.exe' Line 104  target = 'EsysExceptionTest.exe'
104    
105  esysexception_env = Environment(ENV = os.environ)  esysexception_env = Environment(ENV = os.environ)
106    
107  esysexception_env.Replace(CXX = 'icc')  esysexception_env.Replace(CXX = cxx)
 esysexception_env.Replace(CC = 'icc')  
108  esysexception_env.Replace(CXXFLAGS = cxx_flags)  esysexception_env.Replace(CXXFLAGS = cxx_flags)
 esysexception_env.Replace(CCFLAGS = cxx_flags)  
109  esysexception_env.Replace(CPPPATH = cpp_path)  esysexception_env.Replace(CPPPATH = cpp_path)
110  esysexception_env.Replace(LIBPATH = lib_path)  esysexception_env.Replace(LIBPATH = lib_path)
111  esysexception_env.Replace(LIBS = libs)  esysexception_env.Replace(LIBS = libs)
112    
113  esysexception_test_exe = esysexception_env.Program(target, sources)  esysexception_test_exe = esysexception_env.Program(target, sources)
114    
115    Depends(esysexception_test_exe, esysUtils_lib)
116    
117    esysexception_env.Install(install_dir, esysexception_test_exe)

Legend:
Removed from v.197  
changed lines
  Added in v.306

  ViewVC Help
Powered by ViewVC 1.1.26