/[escript]/branches/domexper/pycad/test/python/SConscript
ViewVC logotype

Diff of /branches/domexper/pycad/test/python/SConscript

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

revision 3250 by jfenwick, Tue Aug 3 04:04:51 2010 UTC revision 3251 by jfenwick, Thu Oct 7 04:02:30 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    
19    # files defining test runs (passing in a release)
20    testruns = ['run_pycad_test.py']
21    
 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_') ]  
 #  
 #  files defining test runs (passing in a release)  
 #  
 testruns = []  
 testruns += ['run_pycad_test.py']  
 #  
22  # files defining tests run locally (not as part of a release)  # files defining tests run locally (not as part of a release)
23  #  localtestruns = [x for x in Glob('*.py', strings=True) if not x.startswith('run_')]
24  localtestruns = [x for x in filenames if not x.startswith('run_') and os.path.splitext(x)[1] in ['.py']]  
25  #  # all tests
 # all test  
 #  
26  alltestruns = testruns + localtestruns  alltestruns = testruns + localtestruns
 #  
 # test files are just compiled:  
 #  
 test_pyc = env.PyCompile(testfiles)  
 env.Alias('build_py_tests', test_pyc)  
27    
28  #Add Unit Test to target alias  # test files are just compiled - none of those in pycad yet
29    #sources = Glob('test_*.py')
30    #test_pyc = env.PyCompile(sources)
31    #env.Alias('build_py_tests', test_pyc)
32    
33    # add unit test to target alias
34  local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/pycad/test/python')))  local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/pycad/test/python')))
35  local_env['ENV']['ESCRIPT_TEST_DATA_ROOT']=env.Dir('#/pycad/test/python').srcnode().abspath  local_env['ENV']['ESCRIPT_TEST_DATA_ROOT']=env.Dir('#/pycad/test/python').srcnode().abspath
36  local_env['ENV']['ESCRIPT_WORKDIR']=env.Dir('#/build/$PLATFORM/pycad/test/python').srcnode().abspath  local_env['ENV']['ESCRIPT_WORKDIR']=env.Dir('#/build/$PLATFORM/pycad/test/python').srcnode().abspath
37  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])
38  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])
39    
40  #  # run all tests
 # run all tests:  
 #  
41  program = local_env.RunPyUnitTest(alltestruns)  program = local_env.RunPyUnitTest(alltestruns)
42    
43  # Add a group of tests  # add a group of tests
44  from grouptest import *  from grouptest import *
45  tgroup=GroupTest("$PYTHONRUNNER ",(("ESCRIPT_TEST_DATA_ROOT","$BATCH_ROOT/pycad/test/python"),("ESCRIPT_WORKDIR","$BUILD_DIR/pycad/test/python")),"$BUILD_DIR/pycad/test/python","$BATCH_ROOT/pycad/test/python",testruns)  tgroup=GroupTest("$PYTHONRUNNER ",(("ESCRIPT_TEST_DATA_ROOT","$BATCH_ROOT/pycad/test/python"),("ESCRIPT_WORKDIR","$BUILD_DIR/pycad/test/python")),"$BUILD_DIR/pycad/test/python","$BATCH_ROOT/pycad/test/python",testruns)
46  TestGroups.append(tgroup)  TestGroups.append(tgroup)
47    
 Depends(program, local_env['pyinstall'])  
 Depends(program, dep_lib)  
 Depends(program, 'build_py_tests')  

Legend:
Removed from v.3250  
changed lines
  Added in v.3251

  ViewVC Help
Powered by ViewVC 1.1.26