/[escript]/trunk/modellib/test/python/SConscript
ViewVC logotype

Annotation of /trunk/modellib/test/python/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6651 - (hide annotations)
Wed Feb 7 02:12:08 2018 UTC (13 months, 1 week ago) by jfenwick
File size: 2047 byte(s)
Make everyone sad by touching all the files

Copyright dates update

1 ksteube 1811
2 jfenwick 3982 ##############################################################################
3 ksteube 1705 #
4 jfenwick 6651 # Copyright (c) 2003-2018 by The University of Queensland
5 jfenwick 3982 # http://www.uq.edu.au
6 ksteube 1705 #
7 ksteube 1811 # Primary Business: Queensland, Australia
8 jfenwick 6112 # Licensed under the Apache License, version 2.0
9     # http://www.apache.org/licenses/LICENSE-2.0
10 ksteube 1705 #
11 jfenwick 3982 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 jfenwick 4657 # Development 2012-2013 by School of Earth Sciences
13     # Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 jfenwick 3982 #
15     ##############################################################################
16 ksteube 1705
17 jfenwick 3259 from os.path import splitext
18 gross 703 Import('*')
19 ksteube 1705
20 jfenwick 3259 local_env = env.Clone()
21 ksteube 1705
22 jfenwick 3259 # files defining test runs (passing in a release)
23 sshaw 5041 testruns = Glob('run_*.py', strings=True)
24 jfenwick 3259
25 gross 703 # files defining tests run locally (not as part of a release)
26 jfenwick 3259 localtestruns = [x for x in Glob('*.py', strings=True) if not x.startswith('run_')]
27    
28     # all tests
29 gross 703 alltestruns = testruns + localtestruns
30 jfenwick 3259
31 sshaw 5017 # test files are just compiled
32     sources = Glob('*.py')
33     test_pyc = env.PyCompile(sources)
34     env.Alias('build_py_tests', test_pyc)
35 jfenwick 3259
36     # add unit test to target alias
37 caltinay 3349 local_env.PrependENVPath('PYTHONPATH', env.Dir('$BUILD_DIR/$PLATFORM/escript/test/python').abspath)
38     local_env.PrependENVPath('PYTHONPATH', Dir('.').abspath)
39     local_env['ENV']['MODELLIB_TEST_DATA_ROOT']=Dir('.').srcnode().abspath
40     local_env['ENV']['MODELLIB_WORKDIR']=Dir('.').abspath
41 jfenwick 3259 env.Alias('local_py_tests',[splitext(x)[0]+'.passed' for x in alltestruns])
42     env.Alias('py_tests', [splitext(x)[0]+'.passed' for x in testruns])
43    
44     # run all tests
45 gross 703 program = local_env.RunPyUnitTest(alltestruns)
46 jfenwick 3259 Depends(program, 'build_py_tests')
47 gross 703
48 jfenwick 3259 # add a group of tests
49 caltinay 6034 from grouptest import GroupTest
50     tgroup=GroupTest("modellib", "$PYTHONRUNNER ", (("MODELLIB_TEST_DATA_ROOT","$BATCH_ROOT/modellib/test/python"),('MODELLIB_WORKDIR','$BUILD_DIR/modellib/test/python')), "$BATCH_ROOT/escriptcore/test/python:$BATCH_ROOT/modellib/test/python", "$BATCH_ROOT/modellib/test/python", testruns)
51 jfenwick 2262 tgroup.makeDir("$BUILD_DIR/modellib/test/python")
52 jfenwick 2235 TestGroups.append(tgroup)
53    

  ViewVC Help
Powered by ViewVC 1.1.26