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

Diff of /trunk/finley/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    
19  src_dir = local_env.Dir('.').srcnode().abspath  # files defining test runs (passing in a release)
 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)  
 #  
20  testruns = []  testruns = []
21  testruns += ['run_escriptOnFinley.py']  testruns += ['run_escriptOnFinley.py']
22  testruns += ['run_generators.py']  testruns += ['run_generators.py']
# Line 42  testruns += ['run_models.py'] Line 29  testruns += ['run_models.py']
29  testruns += ['run_simplesolve.py']  testruns += ['run_simplesolve.py']
30  testruns += ['run_utilOnFinley.py']  testruns += ['run_utilOnFinley.py']
31  testruns += ['run_visualization_interface.py']  testruns += ['run_visualization_interface.py']
32  #  
33  #  files defining a few tests for a quick test  #  files defining a few tests for a quick test
 #  
34  scalable_tests = []  scalable_tests = []
35  scalable_tests += ['run_inputOutput.py']  scalable_tests += ['run_inputOutput.py']
36  scalable_tests += ['run_simplesolve.py']  scalable_tests += ['run_simplesolve.py']
37  #  
38  # files defining tests run locally (not as part of a release)  # files defining tests run locally (not as part of a release)
39  #  localtestruns = [x for x in Glob('*.py', strings=True) if not x.startswith('run_')]
40  localtestruns = [x for x in filenames if not x.startswith('run_') and os.path.splitext(x)[1] in ['.py']]  
41  #  # all tests
 # all test  
 #  
42  alltestruns = testruns + localtestruns  alltestruns = testruns + localtestruns
 #  
 # test files are just compiled:  
 #  
 test_pyc = env.PyCompile(testfiles)  
 env.Alias('build_py_tests',test_pyc)  
43    
44  #Add Unit Test to target alias  # test files are just compiled - none of those in finley yet
45    #sources = Glob('test_*.py')
46    #test_pyc = env.PyCompile(sources)
47    #env.Alias('build_py_tests', test_pyc)
48    
49    # add unit test to target alias
50  local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/finley/test/python')))  local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/finley/test/python')))
51  local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/escript/test/python')))  local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/escript/test/python')))
52  local_env['ENV']['FINLEY_TEST_DATA']=env.Dir('#/finley/test/python').srcnode().abspath  local_env['ENV']['FINLEY_TEST_DATA']=env.Dir('#/finley/test/python').srcnode().abspath
53  local_env['ENV']['FINLEY_WORKDIR']=env.Dir('#/build/$PLATFORM/finley/test/python').srcnode().abspath  local_env['ENV']['FINLEY_WORKDIR']=env.Dir('#/build/$PLATFORM/finley/test/python').srcnode().abspath
54  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])
55  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 ])
56  env.Alias('scalable_tests', [os.path.splitext(x)[0]+'.passed' for x in scalable_tests ])  env.Alias('scalable_tests', [splitext(x)[0]+'.passed' for x in scalable_tests])
57    
58  #  # run all tests
 # run all tests:  
 #  
59  program = local_env.RunPyUnitTest(alltestruns)  program = local_env.RunPyUnitTest(alltestruns)
60    Depends(program, py_wrapper_lib)
61    
62  # Add a group of tests  # add a group of tests
63  from grouptest import *  from grouptest import *
64  tgroup=GroupTest("$PYTHONRUNNER ",(("FINLEY_TEST_DATA","$BATCH_ROOT/finley/test/python"),('FINLEY_WORKDIR','$BUILD_DIR/finley/test/python')),"$BUILD_DIR/escript/test/python:$BUILD_DIR/finley/test/python","$BATCH_ROOT/finley/test/python",testruns)  tgroup=GroupTest("$PYTHONRUNNER ",(("FINLEY_TEST_DATA","$BATCH_ROOT/finley/test/python"),('FINLEY_WORKDIR','$BUILD_DIR/finley/test/python')),"$BUILD_DIR/escript/test/python:$BUILD_DIR/finley/test/python","$BATCH_ROOT/finley/test/python",testruns)
65  tgroup.makeDir("$BUILD_DIR/finley/test/python")  tgroup.makeDir("$BUILD_DIR/finley/test/python")
66  TestGroups.append(tgroup)  TestGroups.append(tgroup)
67    
 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