/[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 252 by jgs, Tue Nov 29 05:58:03 2005 UTC trunk/esysUtils/test/EsysException/SConscript revision 682 by robwdcock, Mon Mar 27 02:43:09 2006 UTC
# Line 1  Line 1 
 # Scons configuration file for esysUtils unit tests  
   
 import os  
 import sys  
   
 # ensure correct versions of python and scons  
   
 EnsurePythonVersion(2,3)  
 EnsureSConsVersion(0,96)  
   
 #  
 # set appropriate defaults for configuration variables  
   
 esysroot = Dir('#../../..')  
 usegcc = 0  
 options = None  
 sys_libs = []  
   
 #  
 # import configuration variables passed in from  
 # calling SConscript (if any)  
   
1  Import('*')  Import('*')
2    # FIXME: This whole test should be refactored into the directory above as esysUtils_UnitTest so it is the same as the other modules
3    
4  #  program_name = 'EsysExceptionTest'
 # retreive command-line arguments if any  
   
 if ARGUMENTS.get('usegcc',0):  
   usegcc = 1  
   
 if ARGUMENTS.get('options',0):  
   options = ARGUMENTS.get('options',0)  
   
 #  
 # determine platform  
   
 env = Environment(ENV = os.environ)  
 platform = env['PLATFORM']  
5    
6  #  local_env=env.Copy()
 # determine hostname  
7    
8  hostname = os.environ['HOSTNAME']  local_env.Append(LIBS=['esysUtils', 'CppUnitTest', sys_libs])
9    
10  #  src_dir = local_env.Dir('.').srcnode().abspath
 # load configuration settings  
11    
12  options_dir = str(esysroot) + '/scons'  import os
13  sys.path.append(options_dir)  filenames = os.listdir(src_dir)
14    sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]
 if hostname=='ess':  
   from ess_options import *  
   
 if usegcc==1:  
   from gcc_options import *  
   
 if options!=None:  
   exec "from " + options + " import *"  
   
 cxx_flags=cxx_flags_debug  
   
 #  
 # print out build configuration for this module  
   
 print "####################################################"  
 print "Build configuration for module: EsysException unit tests"  
 print "         dodebug:  1"  
 print "          usegcc: ", usegcc  
 print "             cxx: ", cxx  
 print "        platform: ", platform  
 print "        hostname: ", hostname  
 print "####################################################"  
   
 #  
 # do the actual build  
   
 esysexception_test_path = str(esysroot) + '/esysUtils/test/EsysException'  
 esysUtils_path = str(esysroot) + '/esysUtils/inc'  
 CppUnitTest_path = str(esysroot) + '/tools/CppUnitTest/inc'  
   
 esysUtils_lib_path = str(esysroot) + '/esysUtils/lib'  
 CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib'  
   
 cpp_path = [esysexception_test_path,  
             esysUtils_path,  
             CppUnitTest_path]  
   
 lib_path = [esysUtils_lib_path,  
             CppUnitTest_lib_path]  
15    
16  libs = ['esysUtils',  local_env.Append(CPPPATH = ['#/tools/CppUnitTest/inc',])
         'CppUnitTest']  
17    
18  libs.extend(sys_libs)  program = local_env.Program(program_name, sources)
19    
20  sources = ['EsysExceptionTestCase.cpp',  Depends(program, dep_lib)
            'EsysExceptionTest.cpp']  
21    
22  target = 'EsysExceptionTest.exe'  # TODO: Need to decide on how the library paths etc are going to be handled
23    # TODO: For now just install the program to the same location as the libraries so things can run at least
24    test_install = local_env.Install(libinstall, program)
25    
26  esysexception_env = Environment(ENV = os.environ)  #Add Unit Test to target alias
27    
28  esysexception_env.Replace(CXX = cxx)  env.Alias('build_tests', test_install)
 esysexception_env.Replace(CXXFLAGS = cxx_flags)  
 esysexception_env.Replace(CPPPATH = cpp_path)  
 esysexception_env.Replace(LIBPATH = lib_path)  
 esysexception_env.Replace(LIBS = libs)  
29    
30  esysexception_test_exe = esysexception_env.Program(target, sources)  # run the tests - but only if test_targets are stale
31    local_env.RunUnitTest(program_name)
32    test_targets = os.path.splitext(program_name)[0]+'.passed'
33    Alias("run_tests", test_targets)

Legend:
Removed from v.252  
changed lines
  Added in v.682

  ViewVC Help
Powered by ViewVC 1.1.26