source: misc/tools/acceptance_tests/test_test_all.py @ 7276

Last change on this file since 7276 was 7276, checked in by ole, 15 years ago

Merged numpy branch back into the trunk.

In ~/sandpit/anuga/anuga_core/source
svn merge -r 6246:HEAD ../../branches/numpy .

In ~/sandpit/anuga/anuga_validation
svn merge -r 6417:HEAD ../branches/numpy_anuga_validation .

In ~/sandpit/anuga/misc
svn merge -r 6809:HEAD ../branches/numpy_misc .

For all merges, I used numpy version where conflicts existed

The suites test_all.py (in source/anuga) and validate_all.py passed using Python2.5 with numpy on my Ubuntu Linux box.

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#!/bin/env python
2
3'''Testlet to run the 'test_all.py' ANUGA script.'''
4
5import os
6import time
7import test_utils as util
8
9name = 'Running ANUGA test_all.py'
10
11def test(logfile):
12    result = True
13
14    (cluster, domain) = util.get_hostname()
15
16    # get python to run
17    python_env_var = os.getenv('PYTHON')
18
19    # remember the directory we are in and go to ANUGA test directory
20    home_directory = os.getcwd()
21    pythonpath = os.getenv('PYTHONPATH')
22    os.chdir(os.path.join(pythonpath, 'anuga'))
23
24    # compile C code
25    util.log_print_nl(logfile, '%s compile_all.py' % python_env_var)
26    (_, fd) = os.popen4('%s compile_all.py' % python_env_var)
27    compile_result = fd.read()
28    status = fd.close()
29    util.log_print(logfile, compile_result)
30
31    # run test_all.py
32    util.log_print_nl(logfile, '%s test_all.py' % python_env_var)
33    (_, fd) = os.popen4('%s test_all.py' % python_env_var)
34    test_result = fd.read()
35    status = fd.close()
36    util.log_print(logfile, test_result)
37
38    # return to original directory
39    os.chdir(home_directory)
40
41    return result
42
43
44if __name__ == '__main__':
45    import sys
46
47    home_directory = os.getcwd()
48    logfile = os.path.join(home_directory, 'test.log')
49    if len(sys.argv) > 1:
50        logfile = sys.argv[1]
51
52    try:
53        os.remove(logfile)
54    except:
55        pass
56
57    if not test(logfile):
58        sys.exit(10)
59
60    sys.exit(0)
Note: See TracBrowser for help on using the repository browser.