OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 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 """Runs all types of tests from one unified interface.""" | 7 """Runs all types of tests from one unified interface.""" |
8 | 8 |
9 import collections | 9 import collections |
10 import logging | 10 import logging |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 """Adds gtest options to |option_parser|.""" | 93 """Adds gtest options to |option_parser|.""" |
94 | 94 |
95 option_parser.usage = '%prog gtest [options]' | 95 option_parser.usage = '%prog gtest [options]' |
96 option_parser.commands_dict = {} | 96 option_parser.commands_dict = {} |
97 option_parser.example = '%prog gtest -s base_unittests' | 97 option_parser.example = '%prog gtest -s base_unittests' |
98 | 98 |
99 # TODO(gkanwar): Make this option required | 99 # TODO(gkanwar): Make this option required |
100 option_parser.add_option('-s', '--suite', dest='suite_name', | 100 option_parser.add_option('-s', '--suite', dest='suite_name', |
101 help=('Executable name of the test suite to run ' | 101 help=('Executable name of the test suite to run ' |
102 '(use -s help to list them).')) | 102 '(use -s help to list them).')) |
103 option_parser.add_option('-f', '--gtest-filter', dest='test_filter', | 103 option_parser.add_option('-f', '--gtest_filter', '--gtest-filter', |
| 104 dest='test_filter', |
104 help='googletest-style filter string.') | 105 help='googletest-style filter string.') |
105 option_parser.add_option('--gtest-also-run-disabled-tests', | 106 option_parser.add_option('--gtest_also_run_disabled_tests', |
| 107 '--gtest-also-run-disabled-tests', |
106 dest='run_disabled', action='store_true', | 108 dest='run_disabled', action='store_true', |
107 help='Also run disabled tests if applicable.') | 109 help='Also run disabled tests if applicable.') |
108 option_parser.add_option('-a', '--test-arguments', dest='test_arguments', | 110 option_parser.add_option('-a', '--test-arguments', dest='test_arguments', |
109 default='', | 111 default='', |
110 help='Additional arguments to pass to the test.') | 112 help='Additional arguments to pass to the test.') |
111 option_parser.add_option('-t', dest='timeout', | 113 option_parser.add_option('-t', dest='timeout', |
112 help='Timeout to wait for each test', | 114 help='Timeout to wait for each test', |
113 type='int', | 115 type='int', |
114 default=60) | 116 default=60) |
115 # TODO(gkanwar): Move these to Common Options once we have the plumbing | 117 # TODO(gkanwar): Move these to Common Options once we have the plumbing |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 | 796 |
795 | 797 |
796 def main(argv): | 798 def main(argv): |
797 option_parser = command_option_parser.CommandOptionParser( | 799 option_parser = command_option_parser.CommandOptionParser( |
798 commands_dict=VALID_COMMANDS) | 800 commands_dict=VALID_COMMANDS) |
799 return command_option_parser.ParseAndExecute(option_parser) | 801 return command_option_parser.ParseAndExecute(option_parser) |
800 | 802 |
801 | 803 |
802 if __name__ == '__main__': | 804 if __name__ == '__main__': |
803 sys.exit(main(sys.argv)) | 805 sys.exit(main(sys.argv)) |
OLD | NEW |