/[escript]/temp_trunk_copy/bruce/test/SConscript
ViewVC logotype

Diff of /temp_trunk_copy/bruce/test/SConscript

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

revision 682 by robwdcock, Mon Mar 27 02:43:09 2006 UTC revision 1312 by ksteube, Mon Sep 24 06:18:44 2007 UTC
# Line 1  Line 1 
1    #          Copyright 2006 by ACcESS MNRF
2    #
3    #              http://www.access.edu.au
4    #       Primary Business: Queensland, Australia
5    #  Licensed under the Open Software License version 3.0
6    #     http://www.opensource.org/licenses/osl-3.0.php
7    #
8    #
9    #
10  Import('*')  Import('*')
11    
12  program_name = 'bruce_UnitTest'  program_name = 'bruce_UnitTest'
13    
14  local_env=env.Copy()  local_env=env.Copy()
15    
16    import os
17    # get the relevant file names:
18  src_dir = local_env.Dir('.').srcnode().abspath  src_dir = local_env.Dir('.').srcnode().abspath
19    filenames = [ x for x in os.listdir(src_dir) if os.path.splitext(x)[1] in [".h", ".c", ".cpp"] ]
20    
 import os  
 filenames = os.listdir(src_dir)  
21  sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]  sources = [x for x in filenames if os.path.splitext(x)[1] in ['.cpp', '.c']]
22    
23  local_env.Append(LIBS=[ python_lib, boost_lib, 'bruce', 'escript', 'esysUtils', 'CppUnitTest', sys_libs])  local_env.Append(LIBS=[ python_lib, boost_lib, 'bruce', 'escript', 'esysUtils', 'CppUnitTest', sys_libs])
24    
25    # compile test
26  program = local_env.Program(program_name, sources)  program = local_env.Program(program_name, sources)
   
 #Add Unit Test to target alias  
   
27  env.Alias('build_tests', program)  env.Alias('build_tests', program)
28    
29  # run the tests - but only if test_targets are stale  # run the tests - but only if test_targets are stale
# Line 23  local_env.RunUnitTest(program_name) Line 31  local_env.RunUnitTest(program_name)
31  test_targets = os.path.splitext(program_name)[0]+'.passed'  test_targets = os.path.splitext(program_name)[0]+'.passed'
32  Alias("run_tests", test_targets)  Alias("run_tests", test_targets)
33    
34    release_srcfiles = [ env.File("SConscript"), ]
35    release_testfiles = [ env.File(x) for x in  filenames ]
36    env.Zip(src_zipfile, release_srcfiles)
37    env.Tar(src_tarfile, release_srcfiles)
38    env.Zip(test_zipfile, release_testfiles)
39    env.Tar(test_tarfile, release_testfiles)
40    
41  local_env.SConscript(dirs = ['#/bruce/test/python'], build_dir='python', duplicate=0)  local_env.SConscript(dirs = ['#/bruce/test/python'], build_dir='python', duplicate=0)

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

  ViewVC Help
Powered by ViewVC 1.1.26