/[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/SConscript revision 425 by gross, Tue Jan 10 04:10:39 2006 UTC trunk/esysUtils/test/SConscript revision 1312 by ksteube, Mon Sep 24 06:18:44 2007 UTC
# Line 1  Line 1 
1  # Scons configuration file for esysUtils unit tests  Import('*')
 esysroot=str(Dir('./../../../..').abspath)  
 execfile(str(File(esysroot+"/scons/esys_options.py")))  
2    
3  cxx_flags=cxx_flags_debug  program_name = 'EsysExceptionTest'
 cc_flags=cc_flags_debug  
4    
5  #  local_env=env.Copy()
 # print out build configuration for this module  
6    
7  print "Build configuration for module: EsysException unit tests"  src_dir = local_env.Dir('.').srcnode().abspath
 print "             cxx: ", cxx  
 print "       cxx_flags: ", cxx_flags  
8    
9  #  import os
10  # do the actual build  # get the relevant file names:
11    src_dir = local_env.Dir('.').srcnode().abspath
12  esysexception_test_path = str(esysroot) + '/esysUtils/test/EsysException'  filenames = [ x for x in os.listdir(src_dir) if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]
 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']  
   
 libs.extend(sys_libs)  
   
 sources = ['EsysExceptionTestCase.cpp',  
            'EsysExceptionTest.cpp']  
13    
14  target = 'EsysExceptionTest.exe'  sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]
15    
16  import os  local_env.Append(LIBS=[ 'esysUtils', 'CppUnitTest', sys_libs] + mpi_libs)
 esysexception_env = Environment(ENV = os.environ)  
17    
18  esysexception_env.Replace(CXX = cxx)  program = local_env.Program(program_name, sources)
 esysexception_env.Replace(CXXFLAGS = cxx_flags)  
 esysexception_env.Replace(CPPPATH = cpp_path)  
 esysexception_env.Replace(LIBPATH = lib_path)  
 esysexception_env.Replace(LIBS = libs)  
19    
20  esysexception_test_exe = esysexception_env.Program(target, sources)  #Add Unit Test to target alias
21    
22  Depends(esysexception_test_exe, esysUtils_lib)  env.Alias('build_tests', program)
23    
24  Alias("build_tests", esysexception_env.Install(install_dir, esysexception_test_exe))  # 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  import scons_extensions  release_srcfiles = [ env.File("SConscript"), ]
30  runUnitTest_builder = Builder(action = scons_extensions.runUnitTest, suffix = '.passed', single_source=True)  release_testfiles = [ env.File(x) for x in  filenames ]
31  esysexception_env.Append(BUILDERS = {'RunUnitTest' : runUnitTest_builder});  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    
 Alias("run_tests", esysexception_env.RunUnitTest(target))  

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

  ViewVC Help
Powered by ViewVC 1.1.26