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

Diff of /trunk/escript/test/SConscript

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

revision 2242 by jfenwick, Wed Feb 4 05:04:20 2009 UTC revision 3259 by jfenwick, Mon Oct 11 01:48:14 2010 UTC
# Line 1  Line 1 
1    
2  ########################################################  ########################################################
3  #  #
4  # Copyright (c) 2003-2008 by University of Queensland  # Copyright (c) 2003-2010 by University of Queensland
5  # Earth Systems Science Computational Center (ESSCC)  # Earth Systems Science Computational Center (ESSCC)
6  # http://www.uq.edu.au/esscc  # http://www.uq.edu.au/esscc
7  #  #
# Line 11  Line 11 
11  #  #
12  ########################################################  ########################################################
13    
14    import re
 import os, re  
15  Import('*')  Import('*')
16    local_env = env.Clone()
17    
18  local_env = clone_env(env_mpi)  # get the test source file names
19    sources = Glob('*.cpp')+Glob('*.c')
20  src_dir = local_env.Dir('.').srcnode().abspath  testname='escript_UnitTest'
21    
22  # get the relevant file names:  # build the executable
23  src_dir = local_env.Dir('.').srcnode().abspath  local_env.Append(LIBS=['escript', 'esysUtils', 'CppUnitTest'])
24  filenames = [ x for x in os.listdir(src_dir) if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]  # some of these test files are too large to optimize
25    local_env['CCFLAGS'] = re.sub('-O[0-9]', '-g', str(local_env['CCFLAGS']))
26  sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]  program = local_env.Program(testname, sources)
27    
28  local_env.Append(LIBS= ['escript', 'esysUtils', 'CppUnitTest'] + local_env['sys_libs'] )  # run the tests - but only if test_targets are stale
29  local_env['CCFLAGS'] = re.sub("-O[0-9]", "-g", str(local_env['CCFLAGS']))   # Some of these test files are too large to optimize  local_env.RunUnitTest(testname)
   
 program = local_env.Program('escript_UnitTest', sources)  
   
 #Add Unit Test to target alias  
30    
31  local_env.Alias('build_tests', program)  # add unit test to target alias
32    Alias('build_tests', program)
33    Alias("run_tests", testname+'.passed')
34    
35  # run the tests - but only if test_targets are stale  # configure python unit tests
36  local_env.RunUnitTest('escript_UnitTest')  local_env.SConscript(dirs = ['#/escript/test/python'], variant_dir='python', duplicate=0, exports=['py_wrapper_lib'])
 test_targets = os.path.splitext('escript_UnitTest')[0]+'.passed'  
 Alias("run_tests", test_targets)  
37    
38  # Add a group of tests  # add a group of tests
39  from grouptest import *  from grouptest import *
40  tgroup=GroupTest("$BINRUNNER ", (),"","$BUILD_ROOT/escript/test",('./escript_UnitTest',))  tgroup=GroupTest("$BINRUNNER ", (), "", "$BUILD_DIR/escript/test", ('./'+testname,))
41  TestGroups.append(tgroup)  TestGroups.append(tgroup)
42    
 local_env.SConscript(dirs = ['#/escript/test/python'], build_dir='python', duplicate=0)  

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

  ViewVC Help
Powered by ViewVC 1.1.26