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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1705 - (show annotations)
Thu Aug 14 05:56:40 2008 UTC (11 years ago) by ksteube
File size: 3141 byte(s)
Branch scons-dev is hereby closed.
Some parts of scons scripts have been re-written.

1 #
2 # $Id$
3 #
4 #######################################################
5 #
6 # Copyright 2003-2007 by ACceSS MNRF
7 # Copyright 2007 by University of Queensland
8 #
9 # http://esscc.uq.edu.au
10 # Primary Business: Queensland, Australia
11 # Licensed under the Open Software License version 3.0
12 # http://www.opensource.org/licenses/osl-3.0.php
13 #
14 #######################################################
15 #
16
17 import os
18 Import('*')
19
20 local_env = clone_env(env)
21
22 src_dir = local_env.Dir('.').srcnode().abspath
23 filenames = os.listdir(src_dir)
24 #
25 # files defining tests but are not running by itself:
26 #
27 testfiles = [x for x in filenames if x.startswith('test_') and os.path.splitext(x)[1] in ['.py'] ]
28 #
29 # directories defining test data
30 #
31 testdata_dir = [x for x in filenames if x.startswith('data_') ]
32 #
33 # files defining test runs (passing in a release)
34 #
35 testruns = []
36 testruns += ['run_camera.py']
37 testruns += ['run_carpet.py']
38 testruns += ['run_carpet_with_lazy_evaluation.py']
39 testruns += ['run_contour.py']
40 testruns += ['run_contour_with_lazy_evaluation.py']
41 testruns += ['run_datacollector.py']
42 testruns += ['run_ellipsoid.py']
43 testruns += ['run_ellipsoid_with_lazy_evaluation.py']
44 testruns += ['run_escript_with_lazy_evaluation.py']
45 testruns += ['run_exporter.py']
46 testruns += ['run_image.py']
47 testruns += ['run_image_with_lazy_evaluation.py']
48 testruns += ['run_legend.py']
49 testruns += ['run_legend_with_lazy_evaluation.py']
50 testruns += ['run_light.py']
51 testruns += ['run_logo.py']
52 testruns += ['run_logo_with_lazy_evaluation.py']
53 testruns += ['run_map.py']
54 testruns += ['run_map_with_lazy_evaluation.py']
55 testruns += ['run_movie_with_lazy_evaluation.py']
56 testruns += ['run_rectangle.py']
57 testruns += ['run_scene.py']
58 testruns += ['run_streamline.py']
59 testruns += ['run_streamline_with_lazy_evaluation.py']
60 testruns += ['run_text.py']
61 testruns += ['run_velocity.py']
62 testruns += ['run_velocity_with_lazy_evaluation.py']
63 #
64 # files defining tests run locally (not as part of a release)
65 #
66 localtestruns = [x for x in filenames if not x.startswith('run_') and os.path.splitext(x)[1] in ['.py']]
67 #
68 # all test
69 #
70 alltestruns = testruns + localtestruns
71 #
72 # test files are just compiled:
73 #
74 test_pyc = env.PyCompile(testfiles)
75 env.Alias('build_py_tests', test_pyc)
76
77 #
78 # run all tests:
79 #
80 try:
81 import vtk
82 VTK_AVAILABLE = True
83 except ImportError:
84 VTK_AVAILABLE =False
85 print "Warning: cannot import vtk. pyvisi tests are skipped."
86
87
88 #Add Unit Test to target alias
89 local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/pyvisi/test/python')))
90 local_env['ENV']['PYVISI_TEST_DATA_ROOT']=env.Dir('#/pyvisi/test/python').srcnode().abspath
91 local_env['ENV']['PYVISI_WORKDIR']=env.Dir('#/build/$PLATFORM/pyvisi/test/python').srcnode().abspath
92
93 if VTK_AVAILABLE:
94 env.Alias('local_py_tests',[os.path.splitext(x)[0]+'.passed' for x in alltestruns])
95 env.Alias('py_tests', [os.path.splitext(x)[0]+'.passed' for x in testruns ])
96 program = local_env.RunPyUnitTest(alltestruns)
97
98 Depends(program, local_env['pyinstall'])
99 # Depends(program, dep_lib)
100 Depends(program, 'build_py_tests')

  ViewVC Help
Powered by ViewVC 1.1.26