OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Runs install and update tests. | 6 """Runs install and update tests. |
7 | 7 |
8 Install tests are performed using a single Chrome build, whereas two or more | 8 Install tests are performed using a single Chrome build, whereas two or more |
9 builds are needed for Update tests. There are separate command arguments for | 9 builds are needed for Update tests. There are separate command arguments for |
10 the builds that will be used for each of the tests. If a test file contains | 10 the builds that will be used for each of the tests. If a test file contains |
(...skipping 11 matching lines...) Expand all Loading... |
22 import logging | 22 import logging |
23 import optparse | 23 import optparse |
24 import os | 24 import os |
25 import re | 25 import re |
26 import sys | 26 import sys |
27 import unittest | 27 import unittest |
28 | 28 |
29 import chrome_installer_win | 29 import chrome_installer_win |
30 from install_test import InstallTest | 30 from install_test import InstallTest |
31 | 31 |
| 32 _DIRECTORY = os.path.dirname(os.path.abspath(__file__)) |
| 33 sys.path.append(os.path.join(_DIRECTORY, os.path.pardir, os.path.pardir, |
| 34 os.path.pardir, 'build', 'util', 'lib')) |
| 35 |
32 from common import unittest_util | 36 from common import unittest_util |
33 from common import util | 37 from common import util |
34 | 38 |
35 # To run tests from a module, append the module name to this list. | 39 # To run tests from a module, append the module name to this list. |
36 _TEST_MODULES = ['sample_updater', 'theme_updater'] | 40 _TEST_MODULES = ['sample_updater', 'theme_updater'] |
37 | 41 |
38 for module in _TEST_MODULES: | 42 for module in _TEST_MODULES: |
39 __import__(module) | 43 __import__(module) |
40 | 44 |
41 | 45 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 result = unittest_util.TextTestRunner(verbosity=1).run(tests) | 119 result = unittest_util.TextTestRunner(verbosity=1).run(tests) |
116 del(tests) | 120 del(tests) |
117 if not result.wasSuccessful(): | 121 if not result.wasSuccessful(): |
118 print >>sys.stderr, ('Not all tests were successful.') | 122 print >>sys.stderr, ('Not all tests were successful.') |
119 sys.exit(1) | 123 sys.exit(1) |
120 sys.exit(0) | 124 sys.exit(0) |
121 | 125 |
122 | 126 |
123 if __name__ == '__main__': | 127 if __name__ == '__main__': |
124 Main() | 128 Main() |
OLD | NEW |