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

Diff of /branches/domexper/pyvisi/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    
 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_camera.py']  testruns += ['run_camera.py']
22  testruns += ['run_carpet.py']  testruns += ['run_carpet.py']
# Line 59  testruns += ['run_text.py'] Line 46  testruns += ['run_text.py']
46  testruns += ['run_velocity.py']  testruns += ['run_velocity.py']
47  testruns += ['run_velocity_with_lazy_evaluation.py']  testruns += ['run_velocity_with_lazy_evaluation.py']
48    
 #  
49  # files defining tests run locally (not as part of a release)  # files defining tests run locally (not as part of a release)
50  #  localtestruns = [x for x in Glob('*.py', strings=True) if not x.startswith('run_')]
51  localtestruns = [x for x in filenames if not x.startswith('run_') and os.path.splitext(x)[1] in ['.py']]  
52  #  # all tests
 # all test  
 #  
53  alltestruns = testruns + localtestruns  alltestruns = testruns + localtestruns
 #  
 # test files are just compiled:  
 #  
 test_pyc = env.PyCompile(testfiles)  
 env.Alias('build_py_tests', test_pyc)  
54    
55  #  # test files are just compiled - none of these in pyvisi
56  # run all tests:  #sources = Glob('test_*.py')
57  #  #test_pyc = env.PyCompile(sources)
58  try:  #env.Alias('build_py_tests', test_pyc)
59     import vtk  
60     VTK_AVAILABLE = True  # only run tests if pyvisi enabled
61  except ImportError:  if env['pyvisi']:
62        VTK_AVAILABLE =False      # add unit test to target alias
63        print "Warning: cannot import vtk. pyvisi tests are skipped."      local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/pyvisi/test/python')))
64              local_env['ENV']['PYVISI_TEST_DATA_ROOT']=env.Dir('#/pyvisi/test/python').srcnode().abspath
65        local_env['ENV']['PYVISI_WORKDIR']=env.Dir('#/build/$PLATFORM/pyvisi/test/python').srcnode().abspath
66  #Add Unit Test to target alias  
67  local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/pyvisi/test/python')))      env.Alias('local_py_tests',[splitext(x)[0]+'.passed' for x in alltestruns])
68  local_env['ENV']['PYVISI_TEST_DATA_ROOT']=env.Dir('#/pyvisi/test/python').srcnode().abspath      env.Alias('py_tests', [splitext(x)[0]+'.passed' for x in testruns])
69  local_env['ENV']['PYVISI_WORKDIR']=env.Dir('#/build/$PLATFORM/pyvisi/test/python').srcnode().abspath      program = local_env.RunPyUnitTest(alltestruns)
70        Depends(program, 'build_py_tests')
71  if VTK_AVAILABLE:  
72     env.Alias('local_py_tests',[os.path.splitext(x)[0]+'.passed' for x in alltestruns])      from grouptest import *
73     env.Alias('py_tests', [os.path.splitext(x)[0]+'.passed' for x in testruns ])      tgroup=GroupTest("$PYTHONRUNNER ",(("PYVISI_TEST_DATA_ROOT","$BATCH_ROOT/pyvisi/test/python"),("PYVISI_WORKDIR","$BUILD_DIR/pyvisi/test/python")),"$BUILD_DIR/pyvisi/test/python","$BATCH_ROOT/pyvisi/test/python",testruns)
74     program = local_env.RunPyUnitTest(alltestruns)      tgroup.makeDir('$BUILD_DIR/pyvisi/test/')
75        tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/')
76     Depends(program, local_env['pyinstall'])      tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images')
77     # Depends(program, dep_lib)      tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/camera')
78     Depends(program, 'build_py_tests')      tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/carpet')
79        tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/contour')
80     from grouptest import *      tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/ellipsoid')
81     tgroup=GroupTest("$PYTHONRUNNER ",(("PYVISI_TEST_DATA_ROOT","$BATCH_ROOT/pyvisi/test/python"),("PYVISI_WORKDIR","$BUILD_DIR/pyvisi/test/python")),"$BUILD_DIR/pyvisi/test/python","$BATCH_ROOT/pyvisi/test/python",testruns)      tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/escript')
82     tgroup.makeDir('$BUILD_DIR/pyvisi/test/')      tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/exporter')
83     tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/')      tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/image')
84     tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images')      tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/legend')
85     tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/camera')      tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/light')
86     tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/carpet')      tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/logo')
87     tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/contour')      tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/map')
88     tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/ellipsoid')      tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/movie')
89     tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/escript')      tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/rectangle')
90     tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/exporter')      tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/scene')
91     tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/image')      tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/streamline')
92     tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/legend')      tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/text')
93     tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/light')      tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/velocity')
94     tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/logo')      TestGroups.append(tgroup)
95     tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/map')  
    tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/movie')  
    tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/rectangle')  
    tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/scene')  
    tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/streamline')  
    tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/text')  
    tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/velocity')  
    TestGroups.append(tgroup)  

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

  ViewVC Help
Powered by ViewVC 1.1.26