| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 import optparse | 8 import optparse |
| 9 import os | 9 import os |
| 10 import sys | 10 import sys |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 # Implementation inspired from unittest.main() | 25 # Implementation inspired from unittest.main() |
| 26 class Main(object): | 26 class Main(object): |
| 27 """Main program for running WebDriver tests.""" | 27 """Main program for running WebDriver tests.""" |
| 28 | 28 |
| 29 _options, _args = None, None | 29 _options, _args = None, None |
| 30 TESTS_FILENAME = 'WEBDRIVER_TESTS' | 30 TESTS_FILENAME = 'WEBDRIVER_TESTS' |
| 31 _platform_map = { | 31 _platform_map = { |
| 32 'win32': 'win', | 32 'win32': 'win', |
| 33 'darwin': 'mac', | 33 'darwin': 'mac', |
| 34 'linux2': 'linux', | 34 'linux2': 'linux', |
| 35 'linux3': 'linux', |
| 35 } | 36 } |
| 36 TEST_PREFIX = 'selenium.test.selenium.webdriver.common.' | 37 TEST_PREFIX = 'selenium.test.selenium.webdriver.common.' |
| 37 | 38 |
| 38 def __init__(self): | 39 def __init__(self): |
| 39 self._tests_path = os.path.join(os.path.dirname(__file__), | 40 self._tests_path = os.path.join(os.path.dirname(__file__), |
| 40 self.TESTS_FILENAME) | 41 self.TESTS_FILENAME) |
| 41 self._ParseArgs() | 42 self._ParseArgs() |
| 42 self._Run() | 43 self._Run() |
| 43 | 44 |
| 44 def _ParseArgs(self): | 45 def _ParseArgs(self): |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 verbosity = 1 | 291 verbosity = 1 |
| 291 if self._options.verbose: | 292 if self._options.verbose: |
| 292 verbosity = 2 | 293 verbosity = 2 |
| 293 result = GTestTextTestRunner(verbosity=verbosity).run(test_suite) | 294 result = GTestTextTestRunner(verbosity=verbosity).run(test_suite) |
| 294 launcher.Kill() | 295 launcher.Kill() |
| 295 sys.exit(not result.wasSuccessful()) | 296 sys.exit(not result.wasSuccessful()) |
| 296 | 297 |
| 297 | 298 |
| 298 if __name__ == '__main__': | 299 if __name__ == '__main__': |
| 299 Main() | 300 Main() |
| OLD | NEW |