| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import argparse | 5 import argparse |
| 6 import json | 6 import json |
| 7 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import re | 9 import re |
| 10 import socket | 10 import socket |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 parser.add_argument('--test_filter', '--gtest_filter', type=TestFilter, | 65 parser.add_argument('--test_filter', '--gtest_filter', type=TestFilter, |
| 66 help='The filter to use when discovering tests to run, in the form ' | 66 help='The filter to use when discovering tests to run, in the form ' |
| 67 '<class name>.<method name> Wildcards (*) are accepted. Default=*', | 67 '<class name>.<method name> Wildcards (*) are accepted. Default=*', |
| 68 default='*') | 68 default='*') |
| 69 parser.add_argument('--logging_level', choices=['DEBUG', 'INFO', 'WARN', | 69 parser.add_argument('--logging_level', choices=['DEBUG', 'INFO', 'WARN', |
| 70 'ERROR', 'CRIT'], default='WARN', help='The logging verbosity for log ' | 70 'ERROR', 'CRIT'], default='WARN', help='The logging verbosity for log ' |
| 71 'messages, printed to stderr. To see stderr logging output during a ' | 71 'messages, printed to stderr. To see stderr logging output during a ' |
| 72 'successful test run, also pass --disable_buffer. Default=ERROR') | 72 'successful test run, also pass --disable_buffer. Default=ERROR') |
| 73 parser.add_argument('--log_file', help='If given, write logging statements ' | 73 parser.add_argument('--log_file', help='If given, write logging statements ' |
| 74 'to the given file instead of stderr.') | 74 'to the given file instead of stderr.') |
| 75 parser.add_argument('--skip_slow', action='store_true', help='If set, tests ' |
| 76 'marked as slow will be skipped.', default=False) |
| 75 return parser.parse_args(sys.argv[1:]) | 77 return parser.parse_args(sys.argv[1:]) |
| 76 | 78 |
| 77 def GetLogger(name='common'): | 79 def GetLogger(name='common'): |
| 78 """Creates a Logger instance with the given name and returns it. | 80 """Creates a Logger instance with the given name and returns it. |
| 79 | 81 |
| 80 If a logger has already been created with the same name, that instance is | 82 If a logger has already been created with the same name, that instance is |
| 81 returned instead. | 83 returned instead. |
| 82 | 84 |
| 83 Args: | 85 Args: |
| 84 name: The name of the logger to return. | 86 name: The name of the logger to return. |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 for test_suite in test_suite_iter: | 669 for test_suite in test_suite_iter: |
| 668 for test_case in test_suite: | 670 for test_case in test_suite: |
| 669 for test in test_case: | 671 for test in test_case: |
| 670 # Drop the file name in the form <filename>.<classname>.<methodname> | 672 # Drop the file name in the form <filename>.<classname>.<methodname> |
| 671 test_id = test.id()[test.id().find('.') + 1:] | 673 test_id = test.id()[test.id().find('.') + 1:] |
| 672 if re.match(test_filter_re, test_id): | 674 if re.match(test_filter_re, test_id): |
| 673 tests.addTest(test) | 675 tests.addTest(test) |
| 674 testRunner = unittest.runner.TextTestRunner(verbosity=2, | 676 testRunner = unittest.runner.TextTestRunner(verbosity=2, |
| 675 failfast=flags.failfast, buffer=(not flags.disable_buffer)) | 677 failfast=flags.failfast, buffer=(not flags.disable_buffer)) |
| 676 testRunner.run(tests) | 678 testRunner.run(tests) |
| OLD | NEW |