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

Annotation of /trunk/modellib/test/python/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2262 - (hide annotations)
Wed Feb 11 01:58:06 2009 UTC (10 years, 6 months ago) by jfenwick
File size: 2479 byte(s)
Create missing directory in script.

1 ksteube 1811
2     ########################################################
3 ksteube 1705 #
4 ksteube 1811 # Copyright (c) 2003-2008 by University of Queensland
5     # Earth Systems Science Computational Center (ESSCC)
6     # http://www.uq.edu.au/esscc
7 ksteube 1705 #
8 ksteube 1811 # 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 ksteube 1705 #
12 ksteube 1811 ########################################################
13 ksteube 1705
14 ksteube 1811
15 ksteube 1705 import os
16 gross 703 Import('*')
17 ksteube 1705
18     local_env = clone_env(env)
19    
20 gross 703 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 ksteube 1705 testruns = []
34     testruns += ['run_convection.py']
35     testruns += ['run_flow.py']
36     testruns += ['run_temp.py']
37     #
38 gross 703 # files defining tests run locally (not as part of a release)
39     #
40     localtestruns = [x for x in filenames if not x.startswith('run_') and os.path.splitext(x)[1] in ['.py']]
41     #
42     # all test
43     #
44     alltestruns = testruns + localtestruns
45     #
46     # test files are just compiled:
47     #
48 gross 706 test_pyc = env.PyCompile(testfiles)
49     env.Alias('build_py_tests',test_pyc)
50 gross 703 #
51     # run all tests:
52     #
53     program = local_env.RunPyUnitTest(alltestruns)
54    
55 jfenwick 2235 # Add a group of tests
56     from grouptest import *
57     tgroup=GroupTest("$PYTHONRUNNER ",(("MODELLIB_TEST_DATA_ROOT","$BATCH_ROOT/modellib/test/python"),('MODELLIB_WORKDIR','$BUILD_DIR/modellib/test/python')),"$BUILD_DIR/escript/test/python:$BUILD_DIR/modellib/test/python","$BATCH_ROOT/modellib/test/python",testruns)
58 jfenwick 2262 tgroup.makeDir("$BUILD_DIR/modellib/test")
59     tgroup.makeDir("$BUILD_DIR/modellib/test/python")
60 jfenwick 2235 TestGroups.append(tgroup)
61    
62    
63 ksteube 1705 Depends(program, local_env['pyinstall'])
64 gross 703 Depends(program, dep_lib)
65 gross 706 Depends(program, 'build_py_tests')
66 gross 703
67     #Add Unit Test to target alias
68 gross 705 local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/escript/test/python')))
69 gross 706 local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/modellib/test/python')))
70 gross 709 local_env['ENV']['MODELLIB_TEST_DATA_ROOT']=env.Dir('#/modellib/test/python').srcnode().abspath
71     local_env['ENV']['MODELLIB_WORKDIR']=env.Dir('#/build/$PLATFORM/modellib/test/python').srcnode().abspath
72 gross 703 env.Alias('local_py_tests',[os.path.splitext(x)[0]+'.passed' for x in alltestruns])
73     env.Alias('py_tests', [os.path.splitext(x)[0]+'.passed' for x in testruns ])
74    

  ViewVC Help
Powered by ViewVC 1.1.26