1 |
|
|
2 |
######################################################## |
######################################################## |
3 |
# |
# |
4 |
# Copyright (c) 2003-2008 by University of Queensland |
# Copyright (c) 2003-2010 by University of Queensland |
5 |
# Earth Systems Science Computational Center (ESSCC) |
# Earth Systems Science Computational Center (ESSCC) |
6 |
# http://www.uq.edu.au/esscc |
# http://www.uq.edu.au/esscc |
7 |
# |
# |
32 |
f_in=File(os.path.join(src_dir,i)) |
f_in=File(os.path.join(src_dir,i)) |
33 |
f_out=File(i,test_dir) |
f_out=File(i,test_dir) |
34 |
data_files.append(Command(f_out, f_in, Copy("$TARGET", "$SOURCE"))) |
data_files.append(Command(f_out, f_in, Copy("$TARGET", "$SOURCE"))) |
35 |
|
|
36 |
|
#We need this because of cblib.py which needs to be present for other tests to work |
37 |
|
for i in example_deps: |
38 |
|
f_in=File(os.path.join(src_dir,i)) |
39 |
|
f_out=File(i,test_dir) |
40 |
|
data_files.append(Command(f_out, f_in, Copy("$TARGET", "$SOURCE"))) |
41 |
Depends(cc, data_files) |
Depends(cc, data_files) |
42 |
|
|
43 |
np=int(local_env['ENV']['ESCRIPT_NUM_NODES']) |
np=int(local_env['ENV']['ESCRIPT_NUM_NODES']) |
44 |
programs=[] |
programs=[] |
45 |
|
copies=[] |
46 |
for i in example_files: |
for i in example_files: |
47 |
if i.endswith('.py') and (np==1 or not i in example_files_no_mpi): |
if i.endswith('.py') and (np==1 or not i in example_files_no_mpi): |
48 |
f_in=File(os.path.join(src_dir,i)) |
f_in=File(os.path.join(src_dir,i)) |
49 |
f_out=File(i, test_dir) |
f_out=File(i, test_dir) |
50 |
c=Command(f_out, f_in, Copy("$TARGET", "$SOURCE")) |
c=Command(f_out, f_in, Copy("$TARGET", "$SOURCE")) |
51 |
|
copies+=c |
52 |
programs+=local_env.RunPyUnitTest(c) |
programs+=local_env.RunPyUnitTest(c) |
53 |
|
#env.Alias('build_py_tests', programs) |
54 |
|
env.Alias('build_py_tests', data_files) |
55 |
|
env.Alias('build_py_tests', copies) |
56 |
env.Alias('py_tests', programs) |
env.Alias('py_tests', programs) |
57 |
Depends(programs, env['pyinstall']) |
Depends(programs, env['pyinstall']) |
58 |
Depends(programs, data_files) |
Depends(programs, data_files) |
70 |
runs=[] |
runs=[] |
71 |
for i in example_files: |
for i in example_files: |
72 |
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]) |
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]) |
73 |
TestGroups.append(GroupTest("$PYTHONRUNNER ",(),"",os.path.join("$BATCH_ROOT/doc/examples/test",d),runs, single_processor_only=single_processor_only)) |
TestGroups.append(GroupTest("$PYTHONRUNNER ",(),"",os.path.join("$BUILD_DIR/doc/examples/test",d),runs, single_processor_only=single_processor_only)) |