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

Annotation of /trunk/bruce/test/python/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 705 - (hide annotations)
Fri Apr 7 17:57:37 2006 UTC (14 years, 3 months ago) by gross
File size: 1740 byte(s)
python tests are allmost working
1 robwdcock 661 Import('*')
2     local_env=env.Copy()
3     src_dir = local_env.Dir('.').srcnode().abspath
4     import os
5     filenames = os.listdir(src_dir)
6 gross 700 #
7     # files defining tests but are not running by itself:
8     #
9     testfiles = [x for x in filenames if x.startswith('test_') and os.path.splitext(x)[1] in ['.py'] ]
10     #
11     # directories defining test data
12     #
13     testdata_dir = [x for x in filenames if x.startswith('data_') ]
14     #
15     # files defining test runs (passing in a release)
16     #
17     testruns = [x for x in filenames if x.startswith('run_') and os.path.splitext(x)[1] in ['.py'] ]
18     #
19     # files defining tests run locally (not as part of a release)
20     #
21     localtestruns = [x for x in filenames if not x.startswith('run_') and os.path.splitext(x)[1] in ['.py']]
22     #
23     # all test
24     #
25     alltestruns = testruns + localtestruns
26     #
27     # test files are just compiled:
28     #
29     test_pyc = local_env.PyCompile(testfiles)
30     #
31     # run all tests:
32     #
33     program = local_env.RunPyUnitTest(alltestruns)
34 robwdcock 661
35     Depends(program, pyinstall)
36 gross 700 Depends(program, dep_lib)
37 robwdcock 661
38     #Add Unit Test to target alias
39 gross 705 local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/escript/test/python')))
40     local_env.PrependENVPath('BRUCE_TEST_DATA_ROOT',str(env.Dir('#/bruce/test/python')))
41     env.Alias('build_py_tests',test_pyc)
42 gross 700 env.Alias('local_py_tests',[os.path.splitext(x)[0]+'.passed' for x in alltestruns])
43     env.Alias('py_tests', [os.path.splitext(x)[0]+'.passed' for x in testruns ])
44 robwdcock 661
45 gross 700 # get all the python files in the release tar file
46     release_pyfiles = [ env.File("SConscript"), ]
47 gross 705 release_testfiles = [ env.File(x) for x in testfiles + testruns ] + [ local_env.Dir(x) for x in testdata_dir ]
48 gross 700 env.Zip(src_zipfile, release_pyfiles)
49     env.Tar(src_tarfile, release_pyfiles)
50     env.Zip(test_zipfile, release_testfiles)
51     env.Tar(test_tarfile, release_testfiles)
52    

  ViewVC Help
Powered by ViewVC 1.1.26