/[escript]/trunk/finley/test/SConscript
ViewVC logotype

Diff of /trunk/finley/test/SConscript

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1133 by gross, Tue May 8 07:19:33 2007 UTC revision 3597 by caltinay, Thu Sep 15 06:03:17 2011 UTC
# Line 1  Line 1 
 Import('*')  
   
 program_name = 'finley_UnitTest'  
   
 local_env=env.Copy()  
   
 import os  
1    
2  # get the relevant file names:  ########################################################
3  src_dir = local_env.Dir('.').srcnode().abspath  #
4  filenames = [ x for x in os.listdir(src_dir) if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]  # Copyright (c) 2003-2010 by University of Queensland
5    # Earth Systems Science Computational Center (ESSCC)
6    # http://www.uq.edu.au/esscc
7    #
8    # Primary Business: Queensland, Australia
9    # Licensed under the Open Software License version 3.0
10    # http://www.opensource.org/licenses/osl-3.0.php
11    #
12    ########################################################
13    
 sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]  
14    
15  local_env.Append(LIBS= python_libs + boost_libs + ['finley', 'escript', 'paso', 'esysUtils', 'CppUnitTest'] + scsl_libs + mkl_libs + umf_libs + sys_libs)  Import('*')
16    local_env = env.Clone()
 # compile test  
 program = local_env.Program(program_name, sources)  
 env.Alias('build_tests', program)  
   
 # run the tests - but only if test_targets are stale  
 local_env.RunUnitTest(program_name)  
 test_targets = os.path.splitext(program_name)[0]+'.passed'  
 Alias("run_tests", test_targets)  
17    
18  release_srcfiles = [ env.File("SConscript"), ]  if local_env['cppunit']:
19  release_testfiles = [ env.File(x) for x in  filenames ]      # get the test source file names
20  env.Zip(src_zipfile, release_srcfiles)      sources = Glob('*.cpp')+Glob('*.c')
21  env.Zip(test_zipfile, release_testfiles)      testname='finley_UnitTest'
22  try:  
23    env.Tar(src_tarfile, release_srcfiles)      # build the executable
24    env.Tar(test_tarfile, release_testfiles)      local_env.Append(LIBS=['finley', 'escript', 'paso', 'esysUtils']+env['cppunit_libs'])
25  except AttributeError:      program = local_env.Program(testname, sources)
26    pass  
27        # run the tests - but only if test_targets are stale
28        local_env.RunUnitTest(testname)
29    
30        # add unit test to target alias
31        Alias('build_tests', program)
32        Alias("run_tests", testname+'.passed')
33    
34        # add a group of tests
35        from grouptest import *
36        tgroup=GroupTest("$BINRUNNER ", (), "", "$BUILD_DIR/finley/test", ('./'+testname,))
37        TestGroups.append(tgroup)
38    
39    # configure python unit tests
40    local_env.SConscript(dirs = ['#/finley/test/python'], variant_dir='python', duplicate=0, exports=['py_wrapper_lib'])
41    
 local_env.SConscript(dirs = ['#/finley/test/python'], build_dir='python', duplicate=0)  

Legend:
Removed from v.1133  
changed lines
  Added in v.3597

  ViewVC Help
Powered by ViewVC 1.1.26