/[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 3258 by jfenwick, Tue Aug 3 03:12:16 2010 UTC revision 3259 by jfenwick, Mon Oct 11 01:48:14 2010 UTC
# Line 11  Line 11 
11  #  #
12  ########################################################  ########################################################
13    
   
 import os  
14  Import('*')  Import('*')
15    local_env = env.Clone()
16    
17  local_env = clone_env(env_mpi)  # get the test source file names
18    sources = Glob('*.cpp')+Glob('*.c')
19  # get the relevant file names:  testname='finley_UnitTest'
20  src_dir = local_env.Dir('.').srcnode().abspath  
21  filenames = [ x for x in os.listdir(src_dir) if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]  # build the executable
22    local_env.Append(LIBS=['finley', 'escript', 'paso', 'esysUtils', 'CppUnitTest'])
23  sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]  program = local_env.Program(testname, sources)
   
 local_env.Append(LIBS=['finley', 'escript', 'paso', 'esysUtils', 'CppUnitTest'] + env['sys_libs'])  
   
 # compile test  
 program = local_env.Program('finley_UnitTest', sources)  
 env.Alias('build_tests', program)  
24    
25  # run the tests - but only if test_targets are stale  # run the tests - but only if test_targets are stale
26  local_env.RunUnitTest('finley_UnitTest')  local_env.RunUnitTest(testname)
27  test_targets = os.path.splitext('finley_UnitTest')[0]+'.passed'  
28  Alias("run_tests", test_targets)  # add unit test to target alias
29    Alias('build_tests', program)
30    Alias("run_tests", testname+'.passed')
31    
32  CallSConscript(local_env,dirs = ['#/finley/test/python'], variant_dir='python', duplicate=0)  # configure python unit tests
33    local_env.SConscript(dirs = ['#/finley/test/python'], variant_dir='python', duplicate=0, exports=['py_wrapper_lib'])
34    
35  # Add a group of tests  # add a group of tests
36  from grouptest import *  from grouptest import *
37  tgroup=GroupTest("$BINRUNNER ", (),"","$BUILD_DIR/finley/test",('./finley_UnitTest',))  tgroup=GroupTest("$BINRUNNER ", (), "", "$BUILD_DIR/finley/test", ('./'+testname,))
38  TestGroups.append(tgroup)  TestGroups.append(tgroup)
39    

Legend:
Removed from v.3258  
changed lines
  Added in v.3259

  ViewVC Help
Powered by ViewVC 1.1.26