source: branches/numpy_misc/tools/acceptance_tests/test_eqrm.py @ 7025

Last change on this file since 7025 was 7025, checked in by rwilson, 15 years ago

Added EQRM to acceptance suite.

  • Property svn:executable set to *
File size: 1.3 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
29    # run test_all.py
30    util.log_print_nl(logfile, '%s test_all.py' % python_env_var)
31    (_, fd) = os.popen4('%s test_all.py' % python_env_var)
32    test_result = fd.read()
33    status = fd.close()
34    util.log_print(logfile, test_result)
35
36    # return to original directory
37    os.chdir(home_directory)
38
39    return result
40
41
42if __name__ == '__main__':
43    import sys
44
45    home_directory = os.getcwd()
46    logfile = os.path.join(home_directory, 'test.log')
47    if len(sys.argv) > 1:
48        logfile = sys.argv[1]
49
50    try:
51        os.remove(logfile)
52    except:
53        pass
54
55    if not test(logfile):
56        sys.exit(10)
57
58    sys.exit(0)
Note: See TracBrowser for help on using the repository browser.