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

Diff of /trunk/escript/test/python/SConscript

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

revision 3258 by jfenwick, Thu Jan 28 02:03:15 2010 UTC revision 3259 by jfenwick, Mon Oct 11 01:48:14 2010 UTC
# Line 11  Line 11 
11  #  #
12  ########################################################  ########################################################
13    
14    from os.path import splitext
 import os  
15  Import('*')  Import('*')
16    
17  local_env = clone_env(env)  local_env = env.Clone()
18    
 src_dir = local_env.Dir('.').srcnode().abspath  
 filenames = os.listdir(src_dir)  
 #  
 # files defining tests but are not running by itself:  
 #  
 testfiles = [x for x in filenames if x.startswith('test_') and os.path.splitext(x)[1] in ['.py'] ]  
 #  
 # directories defining test data  
 #  
 testdata_dir = [x for x in filenames if x.startswith('data_') ]  
 #  
19  #  files defining test runs (passing in a release)  #  files defining test runs (passing in a release)
 #  
20  testruns = []  testruns = []
21  testruns += ['run_xml.py']  testruns += ['run_xml.py']
22  testruns += ['run_units.py']  testruns += ['run_units.py']
23  testruns += ['run_data_access.py']  testruns += ['run_data_access.py']
24  #  
25  # files defining tests run locally (not as part of a release)  # files defining tests run locally (not as part of a release)
26  #  localtestruns = [x for x in Glob('*.py', strings=True) if not x.startswith('run_')]
27  localtestruns = [x for x in filenames if not x.startswith('run_') and os.path.splitext(x)[1] in ['.py']]  
28  #  # all test
 # all test  
 #  
29  alltestruns = testruns + localtestruns  alltestruns = testruns + localtestruns
30  #  
31  # test files are just compiled:  # test files are just compiled
32  #  sources = Glob('test_*.py')
33  test_pyc = env.PyCompile(testfiles)  test_pyc = env.PyCompile(sources)
34  env.Alias('build_py_tests', test_pyc)  env.Alias('build_py_tests', test_pyc)
35    
36  #Add Unit Test to target alias  # add unit test to target alias
37  local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/escript/test/python')))  local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/escript/test/python')))
38  local_env['ENV']['ESCRIPT_TEST_DATA_ROOT']=env.Dir('#/escript/test/python').srcnode().abspath  local_env['ENV']['ESCRIPT_TEST_DATA_ROOT']=env.Dir('#/escript/test/python').srcnode().abspath
39  local_env['ENV']['ESCRIPT_WORKDIR']=env.Dir('#/build/$PLATFORM/escript/test/python').srcnode().abspath  local_env['ENV']['ESCRIPT_WORKDIR']=env.Dir('#/build/$PLATFORM/escript/test/python').srcnode().abspath
40  env.Alias('local_py_tests',[os.path.splitext(x)[0]+'.passed' for x in alltestruns])  env.Alias('local_py_tests',[splitext(x)[0]+'.passed' for x in alltestruns])
41  env.Alias('py_tests', [os.path.splitext(x)[0]+'.passed' for x in testruns ])  env.Alias('py_tests', [splitext(x)[0]+'.passed' for x in testruns])
42    
43  #  # run all tests
 # run all tests:  
 #  
44  program = local_env.RunPyUnitTest(alltestruns)  program = local_env.RunPyUnitTest(alltestruns)
45    Depends(program, py_wrapper_lib)
46    Depends(program, 'build_py_tests')
47    
48  # Add a group of tests  # add a group of tests
49  from grouptest import *  from grouptest import *
50  tgroup=GroupTest("$PYTHONRUNNER ",(("ESCRIPT_TEST_DATA_ROOT","$BATCH_ROOT/escript/test/python"),('ESCRIPT_WORKDIR','$BUILD_DIR/escript/test/python')),"$BUILD_DIR/escript/test/python","$BATCH_ROOT/escript/test/python",testruns)  tgroup=GroupTest("$PYTHONRUNNER ",(("ESCRIPT_TEST_DATA_ROOT","$BATCH_ROOT/escript/test/python"),('ESCRIPT_WORKDIR','$BUILD_DIR/escript/test/python')),"$BUILD_DIR/escript/test/python","$BATCH_ROOT/escript/test/python",testruns)
   
51  TestGroups.append(tgroup)  TestGroups.append(tgroup)
52    
 Depends(program, local_env['pyinstall'])  
 Depends(program, dep_lib)  
 Depends(program, 'build_py_tests')  

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

  ViewVC Help
Powered by ViewVC 1.1.26