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

Contents of /trunk/modellib/test/python/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1133 - (show annotations)
Tue May 8 07:19:33 2007 UTC (11 years, 8 months ago) by gross
File size: 2211 byte(s)
Changes needed for windows. This still does not work on and has not run on linux and the altix. 
 
There are a few changes in names in the scons script, in particular _libs is used rather than _lib and _libs is always a list. By default on windows MSVC is used. The location of python is at C:\Program Files\python<version>, boost at C:\Program Files\boost and netcdf at C:\Program Files\netcdf. 

 
1 Import('*')
2 local_env=env.Copy()
3 src_dir = local_env.Dir('.').srcnode().abspath
4 import os
5 filenames = os.listdir(src_dir)
6 #
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 = env.PyCompile(testfiles)
30 env.Alias('build_py_tests',test_pyc)
31 #
32 # run all tests:
33 #
34 program = local_env.RunPyUnitTest(alltestruns)
35
36 Depends(program, pyinstall)
37 Depends(program, dep_lib)
38 Depends(program, 'build_py_tests')
39
40 #Add Unit Test to target alias
41 local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/escript/test/python')))
42 local_env.PrependENVPath('PYTHONPATH',str(env.Dir('#/build/$PLATFORM/modellib/test/python')))
43 local_env['ENV']['MODELLIB_TEST_DATA_ROOT']=env.Dir('#/modellib/test/python').srcnode().abspath
44 local_env['ENV']['MODELLIB_WORKDIR']=env.Dir('#/build/$PLATFORM/modellib/test/python').srcnode().abspath
45 env.Alias('local_py_tests',[os.path.splitext(x)[0]+'.passed' for x in alltestruns])
46 env.Alias('py_tests', [os.path.splitext(x)[0]+'.passed' for x in testruns ])
47
48 # get all the python files in the release tar file
49 release_pyfiles = [ env.File("SConscript"), ]
50 release_datafiles=[] # FIXIT: is there a better way?
51 for d in testdata_dir:
52 release_datafiles+=[ d+"/"+x for x in os.listdir(local_env.Dir(d).srcnode().abspath) if not x.startswith('.')]
53 release_testfiles = [ env.File(x) for x in testfiles + testruns ] + [ env.File(x) for x in release_datafiles ]
54 env.Zip(src_zipfile, release_pyfiles)
55 env.Zip(test_zipfile, release_testfiles)
56 try:
57 env.Tar(test_tarfile, release_testfiles)
58 env.Tar(src_tarfile, release_pyfiles)
59 except AttributeError:
60 pass

  ViewVC Help
Powered by ViewVC 1.1.26