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

Annotation of /trunk/finley/test/python/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 757 - (hide annotations)
Mon Jun 26 13:12:56 2006 UTC (13 years, 9 months ago) by woo409
File size: 2155 byte(s)
+ Merge of intelc_win32 branch (revision 741:755) with trunk. Tested on iVEC altix (run_tests and py_tests all pass)

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 gross 706 test_pyc = env.PyCompile(testfiles)
30     env.Alias('build_py_tests',test_pyc)
31 robwdcock 661
32     #Add Unit Test to target alias
33 gross 706 local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/finley/test/python')))
34 gross 705 local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/escript/test/python')))
35 gross 709 local_env['ENV']['FINLEY_TEST_DATA']=env.Dir('#/finley/test/python').srcnode().abspath
36     local_env['ENV']['FINLEY_WORKDIR']=env.Dir('#/build/$PLATFORM/finley/test/python').srcnode().abspath
37 gross 700 env.Alias('local_py_tests',[os.path.splitext(x)[0]+'.passed' for x in alltestruns])
38     env.Alias('py_tests', [os.path.splitext(x)[0]+'.passed' for x in testruns ])
39 robwdcock 661
40 gross 700 # get all the python files in the release tar file
41     release_pyfiles = [ env.File("SConscript"), ]
42 gross 707 release_datafiles=[] # FIXME: is there a better way?
43     for d in testdata_dir:
44     release_datafiles+=[ d+"/"+x for x in os.listdir(local_env.Dir(d).srcnode().abspath) if not x.startswith('.')]
45     release_testfiles = [ env.File(x) for x in testfiles + testruns ] + [ env.File(x) for x in release_datafiles ]
46 gross 700 env.Zip(src_zipfile, release_pyfiles)
47     env.Tar(src_tarfile, release_pyfiles)
48     env.Zip(test_zipfile, release_testfiles)
49     env.Tar(test_tarfile, release_testfiles)
50    
51 woo409 757 #
52     # run all tests:
53     #
54     program = local_env.RunPyUnitTest(alltestruns)
55    
56     Depends(program, pyinstall)
57     Depends(program, dep_lib)
58     Depends(program, 'build_py_tests')

  ViewVC Help
Powered by ViewVC 1.1.26