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

Last change on this file since 7276 was 7276, checked in by ole, 14 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.9 KB
Line 
1#!/bin/env python
2
3'''Testlet to run the EQRM 'test_all.py' script.'''
4
5import os
6import time
7import test_utils as util
8
9name = 'Running EQRM 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 EQRM test directory
20    home_directory = os.getcwd()
21    eqrm_path = os.getenv('EQRMPATH')
22    if not eqrm_path:
23        util.log_print_nl(logfile, "The EQRMPATH environment variable not set, "
24                                   "can't test EQRM.")
25        return False
26
27    os.chdir(os.path.join(eqrm_path))
28    print 'in %s' % os.getcwd()
29
30    # run clean_all.py
31    util.log_print_nl(logfile, '%s clean_all.py' % python_env_var)
32    (fd_in, fd_out) = os.popen4('%s clean_all.py' % python_env_var)
33    fd_in.write('y\n')
34    fd_in.close()
35    clean_result = fd_out.read()
36    fd_out.close()
37    util.log_print(logfile, clean_result)
38
39    # run test_all.py
40    util.log_print_nl(logfile, '%s test_all.py' % python_env_var)
41    (_, fd_out) = os.popen4('%s test_all.py' % python_env_var)
42    test_result = fd_out.read()
43    status = fd_out.close()
44    util.log_print(logfile, test_result)
45
46    # run check_scenarios.py
47    util.log_print_nl(logfile, '%s check_scenarios.py' % python_env_var)
48    (_, fd_out) = os.popen4('%s check_scenarios.py' % python_env_var)
49    test_result = fd_out.read()
50    status = fd_out.close()
51    util.log_print(logfile, test_result)
52
53    # return to original directory
54    os.chdir(home_directory)
55
56    return result
57
58
59if __name__ == '__main__':
60    import sys
61
62    home_directory = os.getcwd()
63    logfile = os.path.join(home_directory, 'test.log')
64    if len(sys.argv) > 1:
65        logfile = sys.argv[1]
66
67    try:
68        os.remove(logfile)
69    except:
70        pass
71
72    if not test(logfile):
73        sys.exit(10)
74
75    sys.exit(0)
Note: See TracBrowser for help on using the repository browser.