/[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 306 by jgs, Mon Dec 5 00:48:01 2005 UTC trunk/esysUtils/test/SConscript revision 1312 by ksteube, Mon Sep 24 06:18:44 2007 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    
3  #  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']  
   
 #  
 # determine hostname  
   
 hostname = os.environ['HOSTNAME']  
   
 #  
 # load configuration settings  
4    
5  options_dir = str(esysroot) + '/scons'  local_env=env.Copy()
 sys.path.append(options_dir)  
6    
7  from default_options import *  src_dir = local_env.Dir('.').srcnode().abspath
8    
9  if hostname=='ess':  import os
10    from ess_options import *  # get the relevant file names:
11    src_dir = local_env.Dir('.').srcnode().abspath
12  if usegcc==1:  filenames = [ x for x in os.listdir(src_dir) if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]
   from gcc_options import *  
   
 if options!=None:  
   exec "from " + options + " import *"  
   
 cxx_flags=cxx_flags_debug  
   
 #  
 # print out build configuration for this module  
   
 print "Build configuration for module: EsysException unit tests"  
 print "         dodebug:  1"  
 print "          usegcc: ", usegcc  
 print "             cxx: ", cxx  
 print "        platform: ", platform  
 print "        hostname: ", hostname  
   
 #  
 # 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'  
   
 esysUtils_lib = str(esysUtils_lib_path) + '/libesysUtils.a'  
   
 install_dir = str(esysroot) + '/esysUtils/test'  
   
 cpp_path = [esysexception_test_path,  
             esysUtils_path,  
             CppUnitTest_path]  
   
 lib_path = [esysUtils_lib_path,  
             CppUnitTest_lib_path]  
   
 libs = ['esysUtils',  
         'CppUnitTest']  
13    
14  libs.extend(sys_libs)  sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]
15    
16  sources = ['EsysExceptionTestCase.cpp',  local_env.Append(LIBS=[ 'esysUtils', 'CppUnitTest', sys_libs] + mpi_libs)
            'EsysExceptionTest.cpp']  
17    
18  target = 'EsysExceptionTest.exe'  program = local_env.Program(program_name, sources)
19    
20  esysexception_env = Environment(ENV = os.environ)  #Add Unit Test to target alias
21    
22  esysexception_env.Replace(CXX = cxx)  env.Alias('build_tests', program)
 esysexception_env.Replace(CXXFLAGS = cxx_flags)  
 esysexception_env.Replace(CPPPATH = cpp_path)  
 esysexception_env.Replace(LIBPATH = lib_path)  
 esysexception_env.Replace(LIBS = libs)  
23    
24  esysexception_test_exe = esysexception_env.Program(target, sources)  # run the tests - but only if test_targets are stale
25    local_env.RunUnitTest(program_name)
26    test_targets = os.path.splitext(program_name)[0]+'.passed'
27    Alias("run_tests", test_targets)
28    
29  Depends(esysexception_test_exe, esysUtils_lib)  release_srcfiles = [ env.File("SConscript"), ]
30    release_testfiles = [ env.File(x) for x in  filenames ]
31    env.Zip(src_zipfile, release_srcfiles)
32    env.Tar(src_tarfile, release_srcfiles)
33    env.Zip(test_zipfile, release_testfiles)
34    env.Tar(test_tarfile, release_testfiles)
35    
 esysexception_env.Install(install_dir, esysexception_test_exe)  

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

  ViewVC Help
Powered by ViewVC 1.1.26