/[escript]/trunk/doc/examples/SConscript
ViewVC logotype

Contents of /trunk/doc/examples/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2508 - (show annotations)
Thu Jul 2 04:33:25 2009 UTC (10 years, 3 months ago) by jfenwick
File size: 2281 byte(s)
Ensured that example files are copied with build_py_tests rather than py_tests.
This means that:
build_full
will set up all the files ready for utest.sh
1
2 ########################################################
3 #
4 # Copyright (c) 2003-2008 by University of Queensland
5 # Earth Systems Science Computational Center (ESSCC)
6 # http://www.uq.edu.au/esscc
7 #
8 # 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 #
12 ########################################################
13
14 from grouptest import *
15 import os
16 Import('*')
17 example_files = example_files_allow_mpi + example_files_no_mpi
18
19
20 local_env = clone_env(env)
21 src_dir = local_env.Dir('.').srcnode().abspath
22 test_dir= Dir('test', local_env.Dir('.'))
23 cc=Command(test_dir, [], Mkdir("$TARGET"))
24 # Execute(Delete(test_dir.srcnode().abspath))
25 # Execute(Mkdir(test_dir.srcnode().abspath))
26 #
27 # create copy of all non-py files:
28 #
29 data_files=[]
30 for i in example_files:
31 if not i.endswith('.py'):
32 f_in=File(os.path.join(src_dir,i))
33 f_out=File(i,test_dir)
34 data_files.append(Command(f_out, f_in, Copy("$TARGET", "$SOURCE")))
35 Depends(cc, data_files)
36
37 np=int(local_env['ENV']['ESCRIPT_NUM_NODES'])
38 programs=[]
39 copies=[]
40 for i in example_files:
41 if i.endswith('.py') and (np==1 or not i in example_files_no_mpi):
42 f_in=File(os.path.join(src_dir,i))
43 f_out=File(i, test_dir)
44 c=Command(f_out, f_in, Copy("$TARGET", "$SOURCE"))
45 copies+=c
46 programs+=local_env.RunPyUnitTest(c)
47 #env.Alias('build_py_tests', programs)
48 env.Alias('build_py_tests', data_files)
49 env.Alias('build_py_tests', copies)
50 env.Alias('py_tests', programs)
51 Depends(programs, env['pyinstall'])
52 Depends(programs, data_files)
53 Depends(cc, data_files)
54 # Add a group of tests
55 # find all directories:
56 for single_processor_only in [True, False]:
57 dirs=[]
58 for i in example_files:
59 if i.endswith('.py'):
60 if single_processor_only == (i in example_files_no_mpi):
61 d=os.path.split(i)[0]
62 if not d in dirs: dirs.append(d)
63 for d in dirs:
64 runs=[]
65 for i in example_files:
66 if i.startswith(d) and i.endswith('.py') and (single_processor_only == (i in example_files_no_mpi)): runs.append(os.path.split(i)[1])
67 TestGroups.append(GroupTest("$PYTHONRUNNER ",(),"",os.path.join("$BUILD_DIR/doc/examples/test",d),runs, single_processor_only=single_processor_only))

  ViewVC Help
Powered by ViewVC 1.1.26