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

Contents of /trunk/doc/examples/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6034 - (show annotations)
Wed Mar 9 00:37:57 2016 UTC (2 years, 8 months ago) by caltinay
File size: 2117 byte(s)
a few changes to GroupTest / utest:
GroupTest class now takes a name parameter that is used as (shell) function
name in utest for the test group.
By default all tests are run as before but one can now do:
./utest.sh build '-t2' escriptcpp
to only run the escript c++ unit tests.
Also tweaked a couple things so utest.sh does now work with dash.

1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2016 by The 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 2012-2013 by School of Earth Sciences
13 # Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 #
15 ##############################################################################
16
17 from grouptest import GroupTest
18 import os
19 Import('*')
20 local_env = env.Clone()
21
22 example_files = example_files_allow_mpi + example_files_no_mpi
23
24 src_dir = local_env.Dir('.').srcnode().abspath
25 test_dir= Dir('test', local_env.Dir('.'))
26 cc=Command(test_dir, [], Mkdir("$TARGET"))
27
28 # create copy of all non-py files:
29 # We need this because of cblib.py which needs to be present for other tests
30 # to work
31 data_files=[]
32 for i in example_deps:
33 f_in=File(os.path.join(src_dir,i))
34 f_out=File(i,test_dir)
35 data_files.append(Command(f_out, f_in, Copy("$TARGET", "$SOURCE")))
36
37 programs=[]
38 copies=[]
39 for i in example_files:
40 if local_env['mpi']=='none' or not i in example_files_no_mpi:
41 f_in=File(os.path.join(src_dir,i))
42 f_out=File(i, test_dir)
43 c=Command(f_out, f_in, Copy("$TARGET", "$SOURCE"))
44 copies+=c
45 programs+=local_env.RunPyExample(c)
46
47 env.Alias('build_py_tests', data_files)
48 env.Alias('build_py_tests', copies)
49 env.Alias('py_tests', programs)
50 Depends(programs, data_files)
51 Depends(cc, data_files)
52
53 # Add group of tests
54 dirs = set([os.path.split(i)[0] for i in example_files])
55 for d in dirs:
56 single_runs=[]
57 runs=[]
58 for i in example_files_no_mpi:
59 if i.startswith(d):
60 single_runs.append(os.path.split(i)[1])
61 for i in example_files_allow_mpi:
62 if i.startswith(d):
63 runs.append(os.path.split(i)[1])
64 TestGroups.append(GroupTest(d, "$PYTHONRUNNER ", (), "", os.path.join("$BATCH_ROOT/doc/examples",d), runs, single_runs))
65

  ViewVC Help
Powered by ViewVC 1.1.26