/[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

trunk/esysUtils/test/EsysException/SConstruct revision 197 by jgs, Tue Nov 22 02:01:35 2005 UTC trunk/esysUtils/test/EsysException/SConscript revision 360 by jgs, Thu Dec 15 01:52:16 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    import socket
44    hostname = socket.gethostname()
45    
46  if esysroot == None:  #
47    esysroot = Dir('#../../..')  # load configuration settings
48    
49  ##### these will enventually be loaded from an external config file ########  options_dir = str(esysroot) + '/scons'
50    sys.path.append(options_dir)
51    
52  cxx_flags = '-O0 -openmp -openmp_report0 -tpp2 -ansi -ansi_alias -no-gcc -fpic -w1'  from default_options import *
53    
54  ############################################################################  if hostname=='ess':
55      from ess_options import *
56    
57    if usegcc==1:
58      from gcc_options import *
59    
60    if options!=None:
61      exec "from " + options + " import *"
62    
63    cxx_flags=cxx_flags_debug
64    
65    #
66    # print out build configuration for this module
67    
68    print "Build configuration for module: EsysException unit tests"
69    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  esysexception_test_path = str(esysroot) + '/esysUtils/test/EsysException'  esysexception_test_path = str(esysroot) + '/esysUtils/test/EsysException'
79  esysUtils_path = str(esysroot) + '/esysUtils/inc'  esysUtils_path = str(esysroot) + '/esysUtils/inc'
# Line 21  CppUnitTest_path = str(esysroot) + '/too Line 82  CppUnitTest_path = str(esysroot) + '/too
82  esysUtils_lib_path = str(esysroot) + '/esysUtils/lib'  esysUtils_lib_path = str(esysroot) + '/esysUtils/lib'
83  CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib'  CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib'
84    
85    esysUtils_lib = str(esysUtils_lib_path) + '/libesysUtils.a'
86    
87    install_dir = str(esysroot) + '/esysUtils/test'
88    
89  cpp_path = [esysexception_test_path,  cpp_path = [esysexception_test_path,
90              esysUtils_path,              esysUtils_path,
91              CppUnitTest_path]              CppUnitTest_path]
# Line 29  lib_path = [esysUtils_lib_path, Line 94  lib_path = [esysUtils_lib_path,
94              CppUnitTest_lib_path]              CppUnitTest_lib_path]
95    
96  libs = ['esysUtils',  libs = ['esysUtils',
97          'CppUnitTest',          'CppUnitTest']
98          'guide',  
99          'irc']  libs.extend(sys_libs)
100    
101  sources = ['EsysExceptionTestCase.cpp',  sources = ['EsysExceptionTestCase.cpp',
102             'EsysExceptionTest.cpp']             'EsysExceptionTest.cpp']
# Line 40  target = 'EsysExceptionTest.exe' Line 105  target = 'EsysExceptionTest.exe'
105    
106  esysexception_env = Environment(ENV = os.environ)  esysexception_env = Environment(ENV = os.environ)
107    
108  esysexception_env.Replace(CXX = 'icc')  esysexception_env.Replace(CXX = cxx)
 esysexception_env.Replace(CC = 'icc')  
109  esysexception_env.Replace(CXXFLAGS = cxx_flags)  esysexception_env.Replace(CXXFLAGS = cxx_flags)
 esysexception_env.Replace(CCFLAGS = cxx_flags)  
110  esysexception_env.Replace(CPPPATH = cpp_path)  esysexception_env.Replace(CPPPATH = cpp_path)
111  esysexception_env.Replace(LIBPATH = lib_path)  esysexception_env.Replace(LIBPATH = lib_path)
112  esysexception_env.Replace(LIBS = libs)  esysexception_env.Replace(LIBS = libs)
113    
114  esysexception_test_exe = esysexception_env.Program(target, sources)  esysexception_test_exe = esysexception_env.Program(target, sources)
115    
116    Depends(esysexception_test_exe, esysUtils_lib)
117    
118    Alias("build_tests", esysexception_env.Install(install_dir, esysexception_test_exe))
119    
120    import scons_extensions
121    runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', single_source=True)
122    esysexception_env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder});
123    
124    Alias("run_tests", esysexception_env.RunUnitTest(target))

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

  ViewVC Help
Powered by ViewVC 1.1.26