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

Contents of /trunk/pyvisi/test/python/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3167 - (show annotations)
Wed Sep 8 03:24:29 2010 UTC (10 years, 7 months ago) by caltinay
File size: 4875 byte(s)
Only run pyvisi tests if VTK was enabled at configuration time.

1
2 ########################################################
3 #
4 # Copyright (c) 2003-2010 by University of Queensland
5 # Earth Systems Science Computational Center (ESSCC)
6 # http://www.uq.edu.au/esscc
7 #
8 # Primary Business: Queensland, Australia
9 # Licensed under the Open Software License version 3.0
10 # http://www.opensource.org/licenses/osl-3.0.php
11 #
12 ########################################################
13
14
15 import os
16 Import('*')
17
18 local_env = clone_env(env)
19
20 src_dir = local_env.Dir('.').srcnode().abspath
21 filenames = os.listdir(src_dir)
22 #
23 # files defining tests but are not running by itself:
24 #
25 testfiles = [x for x in filenames if x.startswith('test_') and os.path.splitext(x)[1] in ['.py'] ]
26 #
27 # directories defining test data
28 #
29 testdata_dir = [x for x in filenames if x.startswith('data_') ]
30 #
31 # files defining test runs (passing in a release)
32 #
33 testruns = []
34 testruns += ['run_camera.py']
35 testruns += ['run_carpet.py']
36 testruns += ['run_carpet_with_lazy_evaluation.py']
37 testruns += ['run_contour.py']
38 testruns += ['run_contour_with_lazy_evaluation.py']
39 testruns += ['run_datacollector.py']
40 testruns += ['run_ellipsoid.py']
41 testruns += ['run_ellipsoid_with_lazy_evaluation.py']
42 testruns += ['run_escript_with_lazy_evaluation.py']
43 testruns += ['run_exporter.py']
44 testruns += ['run_image.py']
45 testruns += ['run_image_with_lazy_evaluation.py']
46 testruns += ['run_legend.py']
47 testruns += ['run_legend_with_lazy_evaluation.py']
48 testruns += ['run_light.py']
49 testruns += ['run_logo.py']
50 testruns += ['run_logo_with_lazy_evaluation.py']
51 testruns += ['run_map.py']
52 testruns += ['run_map_with_lazy_evaluation.py']
53 testruns += ['run_movie_with_lazy_evaluation.py']
54 testruns += ['run_rectangle.py']
55 testruns += ['run_scene.py']
56 testruns += ['run_streamline.py']
57 testruns += ['run_streamline_with_lazy_evaluation.py']
58 testruns += ['run_text.py']
59 testruns += ['run_velocity.py']
60 testruns += ['run_velocity_with_lazy_evaluation.py']
61
62 #
63 # files defining tests run locally (not as part of a release)
64 #
65 localtestruns = [x for x in filenames if not x.startswith('run_') and os.path.splitext(x)[1] in ['.py']]
66 #
67 # all test
68 #
69 alltestruns = testruns + localtestruns
70 #
71 # test files are just compiled:
72 #
73 test_pyc = env.PyCompile(testfiles)
74 env.Alias('build_py_tests', test_pyc)
75
76 #
77 # only run tests if VTK is enabled:
78 #
79 if env['usevtk']:
80 VTK_AVAILABLE = True
81 else:
82 VTK_AVAILABLE = False
83 print "Warning: VTK disabled, skipping pyvisi tests."
84
85
86 #Add Unit Test to target alias
87 local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/pyvisi/test/python')))
88 local_env['ENV']['PYVISI_TEST_DATA_ROOT']=env.Dir('#/pyvisi/test/python').srcnode().abspath
89 local_env['ENV']['PYVISI_WORKDIR']=env.Dir('#/build/$PLATFORM/pyvisi/test/python').srcnode().abspath
90
91 if VTK_AVAILABLE:
92 env.Alias('local_py_tests',[os.path.splitext(x)[0]+'.passed' for x in alltestruns])
93 env.Alias('py_tests', [os.path.splitext(x)[0]+'.passed' for x in testruns ])
94 program = local_env.RunPyUnitTest(alltestruns)
95
96 Depends(program, local_env['pyinstall'])
97 # Depends(program, dep_lib)
98 Depends(program, 'build_py_tests')
99
100 from grouptest import *
101 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)
102 tgroup.makeDir('$BUILD_DIR/pyvisi/test/')
103 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/')
104 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images')
105 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/camera')
106 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/carpet')
107 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/contour')
108 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/ellipsoid')
109 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/escript')
110 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/exporter')
111 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/image')
112 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/legend')
113 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/light')
114 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/logo')
115 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/map')
116 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/movie')
117 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/rectangle')
118 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/scene')
119 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/streamline')
120 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/text')
121 tgroup.makeDir('$BUILD_DIR/pyvisi/test/python/data_sample_images/velocity')
122 TestGroups.append(tgroup)

  ViewVC Help
Powered by ViewVC 1.1.26