/[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/SConscript revision 1388 by trankine, Fri Jan 11 07:45:58 2008 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']  
4    
5  #  local_env=env.Copy()
 # determine hostname  
6    
7  hostname = os.environ['HOSTNAME']  src_dir = local_env.Dir('.').srcnode().abspath
8    
9  #  import os
10  # load configuration settings  # get the relevant file names:
11    src_dir = local_env.Dir('.').srcnode().abspath
12  options_dir = str(esysroot) + '/scons'  filenames = [ x for x in os.listdir(src_dir) if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]
 sys.path.append(options_dir)  
   
 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]  
13    
14  lib_path = [esysUtils_lib_path,  sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]
             CppUnitTest_lib_path]  
15    
16  libs = ['esysUtils',  local_env.Append(LIBS=[ 'esysUtils', 'CppUnitTest', sys_libs] + mpi_libs)
         'CppUnitTest']  
17    
18  libs.extend(sys_libs)  program = local_env.Program(program_name, sources)
19    
20  sources = ['EsysExceptionTestCase.cpp',  #Add Unit Test to target alias
            'EsysExceptionTest.cpp']  
21    
22  target = 'EsysExceptionTest.exe'  env.Alias('build_tests', program)
23    
24  esysexception_env = Environment(ENV = os.environ)  # 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  esysexception_env.Replace(CXX = cxx)  release_srcfiles = [ env.File("SConscript"), ]
30  esysexception_env.Replace(CXXFLAGS = cxx_flags)  release_testfiles = [ env.File(x) for x in  filenames ]
31  esysexception_env.Replace(CPPPATH = cpp_path)  env.Zip(src_zipfile, release_srcfiles)
32  esysexception_env.Replace(LIBPATH = lib_path)  env.Tar(src_tarfile, release_srcfiles)
33  esysexception_env.Replace(LIBS = libs)  env.Zip(test_zipfile, release_testfiles)
34    env.Tar(test_tarfile, release_testfiles)
35    
 esysexception_test_exe = esysexception_env.Program(target, sources)  

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

  ViewVC Help
Powered by ViewVC 1.1.26