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

Contents of /trunk/doc/examples/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3982 - (show annotations)
Fri Sep 21 03:23:22 2012 UTC (7 years ago) by jfenwick
File size: 2740 byte(s)
More edits + removing pyvisi from trunk

1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2012 by University of Queensland
5 # http://www.uq.edu.au
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Open Software License version 3.0
9 # http://www.opensource.org/licenses/osl-3.0.php
10 #
11 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 # Development since 2012 by School of Earth Sciences
13 #
14 ##############################################################################
15
16 from grouptest import *
17 import os
18 Import('*')
19 local_env = env.Clone()
20
21 example_files = example_files_allow_mpi + example_files_no_mpi
22
23 src_dir = local_env.Dir('.').srcnode().abspath
24 test_dir= Dir('test', local_env.Dir('.'))
25 cc=Command(test_dir, [], Mkdir("$TARGET"))
26 # Execute(Delete(test_dir.srcnode().abspath))
27 # Execute(Mkdir(test_dir.srcnode().abspath))
28 #
29 # create copy of all non-py files:
30 #
31 data_files=[]
32 for i in example_files:
33 if not i.endswith('.py'):
34 f_in=File(os.path.join(src_dir,i))
35 f_out=File(i,test_dir)
36 data_files.append(Command(f_out, f_in, Copy("$TARGET", "$SOURCE")))
37
38 # We need this because of cblib.py which needs to be present for other tests
39 # to work
40 for i in example_deps:
41 f_in=File(os.path.join(src_dir,i))
42 f_out=File(i,test_dir)
43 data_files.append(Command(f_out, f_in, Copy("$TARGET", "$SOURCE")))
44 Depends(cc, data_files)
45
46 np=int(local_env['ENV']['ESCRIPT_NUM_NODES'])
47 programs=[]
48 copies=[]
49 for i in example_files:
50 # if i.endswith('.py') and (np==1 or not i in example_files_no_mpi):
51 if i.endswith('.py') and (local_env['mpi']=='none' or not i in example_files_no_mpi):
52 f_in=File(os.path.join(src_dir,i))
53 f_out=File(i, test_dir)
54 c=Command(f_out, f_in, Copy("$TARGET", "$SOURCE"))
55 copies+=c
56 programs+=local_env.RunPyUnitTest(c)
57
58 #env.Alias('build_py_tests', programs)
59 env.Alias('build_py_tests', data_files)
60 env.Alias('build_py_tests', copies)
61 env.Alias('py_tests', programs)
62 Depends(programs, data_files)
63 Depends(cc, data_files)
64
65 # Add a group of tests
66 # find all directories:
67 for single_processor_only in [True, False]:
68 dirs=[]
69 for i in example_files:
70 if i.endswith('.py'):
71 if single_processor_only == (i in example_files_no_mpi):
72 d=os.path.split(i)[0]
73 if not d in dirs: dirs.append(d)
74 for d in dirs:
75 runs=[]
76 for i in example_files:
77 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])
78 TestGroups.append(GroupTest("$PYTHONRUNNER ",(),"",os.path.join("$BUILD_DIR/doc/examples/test",d),runs, single_processor_only=single_processor_only))
79

  ViewVC Help
Powered by ViewVC 1.1.26