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

Annotation of /trunk/doc/examples/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


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

1 gross 2502
2 jfenwick 3982 ##############################################################################
3 gross 2502 #
4 jfenwick 3911 # Copyright (c) 2003-2012 by University of Queensland
5 jfenwick 3982 # http://www.uq.edu.au
6 gross 2502 #
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 jfenwick 3982 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12     # Development since 2012 by School of Earth Sciences
13     #
14     ##############################################################################
15 gross 2502
16     from grouptest import *
17     import os
18     Import('*')
19 jfenwick 3259 local_env = env.Clone()
20    
21 gross 2502 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 jfenwick 3259 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 jfenwick 2648
38 jfenwick 3259 # We need this because of cblib.py which needs to be present for other tests
39     # to work
40 jfenwick 2648 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 gross 2502 Depends(cc, data_files)
45    
46     np=int(local_env['ENV']['ESCRIPT_NUM_NODES'])
47     programs=[]
48 jfenwick 2508 copies=[]
49 gross 2502 for i in example_files:
50 jfenwick 3940 # 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 jfenwick 3259 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 jfenwick 2508 #env.Alias('build_py_tests', programs)
59     env.Alias('build_py_tests', data_files)
60     env.Alias('build_py_tests', copies)
61 gross 2502 env.Alias('py_tests', programs)
62     Depends(programs, data_files)
63     Depends(cc, data_files)
64 jfenwick 3259
65 gross 2502 # 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 jfenwick 2508 TestGroups.append(GroupTest("$PYTHONRUNNER ",(),"",os.path.join("$BUILD_DIR/doc/examples/test",d),runs, single_processor_only=single_processor_only))
79 jfenwick 3259

  ViewVC Help
Powered by ViewVC 1.1.26