Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 # | 3 # |
| 4 # Use of this source code is governed by a BSD-style license | 4 # Use of this source code is governed by a BSD-style license |
| 5 # that can be found in the LICENSE file in the root of the source | 5 # that can be found in the LICENSE file in the root of the source |
| 6 # tree. An additional intellectual property rights grant can be found | 6 # tree. An additional intellectual property rights grant can be found |
| 7 # in the file PATENTS. All contributing project authors may | 7 # in the file PATENTS. All contributing project authors may |
| 8 # be found in the AUTHORS file in the root of the source tree. | 8 # be found in the AUTHORS file in the root of the source tree. |
| 9 | 9 |
| 10 """Runs various WebRTC tests through valgrind_test.py. | 10 """Runs various WebRTC tests through valgrind_test.py. |
| 11 | 11 |
| 12 This script inherits the chrome_tests.py in Chrome, but allows running any test | 12 This script inherits the chrome_tests.py in Chrome, but allows running any test |
| 13 instead of only the hard-coded ones. It uses the -t cmdline flag to do this, and | 13 instead of only the hard-coded ones. It uses the -t cmdline flag to do this, and |
| 14 only supports specifying a single test for each run. | 14 only supports specifying a single test for each run. |
| 15 | 15 |
| 16 Suppression files: | 16 Suppression files: |
| 17 The Chrome valgrind directory we use as a DEPS dependency contains the following | 17 The Chrome valgrind directory we use as a DEPS dependency contains the following |
| 18 suppression files: | 18 suppression files: |
| 19 valgrind/memcheck/suppressions.txt | 19 valgrind/memcheck/suppressions.txt |
| 20 valgrind/memcheck/suppressions_mac.txt | 20 valgrind/memcheck/suppressions_mac.txt |
| 21 Since they're referenced from the chrome_tests.py script, we have similar files | 21 Since they're referenced from the chrome_tests.py script, we have similar files |
| 22 below the directory of this script. When executing, this script will setup both | 22 below the directory of this script. When executing, this script will setup both |
| 23 Chrome's suppression files and our own, so we can easily maintain WebRTC | 23 Chrome's suppression files and our own, so we can easily maintain WebRTC |
| 24 specific suppressions in our own files. | 24 specific suppressions in our own files. |
| 25 """ | 25 """ |
| 26 | 26 |
| 27 import argparse | |
| 27 import logging | 28 import logging |
| 28 import optparse | 29 import optparse |
| 29 import os | 30 import os |
| 30 import sys | 31 import sys |
| 31 | 32 |
| 32 import logging_utils | 33 import logging_utils |
| 33 import path_utils | 34 import path_utils |
| 34 | 35 |
| 35 import chrome_tests | 36 import chrome_tests |
| 36 | 37 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 'developers/maintainers.\nPlease note that the <tool>' | 118 'developers/maintainers.\nPlease note that the <tool>' |
| 118 '.logs directory will be clobbered on tool startup.')) | 119 '.logs directory will be clobbered on tool startup.')) |
| 119 parser.add_option("--test-launcher-bot-mode", action="store_true", | 120 parser.add_option("--test-launcher-bot-mode", action="store_true", |
| 120 help="run the tests with --test-launcher-bot-mode") | 121 help="run the tests with --test-launcher-bot-mode") |
| 121 parser.add_option("--test-launcher-total-shards", type=int, | 122 parser.add_option("--test-launcher-total-shards", type=int, |
| 122 help="run the tests with --test-launcher-total-shards") | 123 help="run the tests with --test-launcher-total-shards") |
| 123 parser.add_option("--test-launcher-shard-index", type=int, | 124 parser.add_option("--test-launcher-shard-index", type=int, |
| 124 help="run the tests with --test-launcher-shard-index") | 125 help="run the tests with --test-launcher-shard-index") |
| 125 options, args = parser.parse_args() | 126 options, args = parser.parse_args() |
| 126 | 127 |
| 128 ignore_parser = argparse.ArgumentParser() | |
| 129 # Ignore Chromium-specific flags | |
| 130 ignore_parser.add_argument('--isolated-script-test-output', | |
| 131 type=str, default=None) | |
| 132 ignore_parser.add_argument('--isolated-script-test-chartjson-output', | |
| 133 type=str, default=None) | |
| 134 _, args = ignore_parser.parse_known_args(args) | |
|
kjellander_webrtc
2017/08/18 12:49:52
Just to check - these are needed since the memchec
oprypin_webrtc
2017/08/18 13:30:28
I think so -- see patch set 1 where memcheck faile
| |
| 135 | |
| 127 if options.verbose: | 136 if options.verbose: |
| 128 logging_utils.config_root(logging.DEBUG) | 137 logging_utils.config_root(logging.DEBUG) |
| 129 else: | 138 else: |
| 130 logging_utils.config_root() | 139 logging_utils.config_root() |
| 131 | 140 |
| 132 if not options.test: | 141 if not options.test: |
| 133 parser.error('--test not specified') | 142 parser.error('--test not specified') |
| 134 | 143 |
| 135 # Support build dir both with and without the target. | 144 # Support build dir both with and without the target. |
| 136 if (options.target and options.build_dir and | 145 if (options.target and options.build_dir and |
| 137 not options.build_dir.endswith(options.target)): | 146 not options.build_dir.endswith(options.target)): |
| 138 options.build_dir = os.path.join(options.build_dir, options.target) | 147 options.build_dir = os.path.join(options.build_dir, options.target) |
| 139 | 148 |
| 140 # If --build_dir is provided, prepend it to the test executable if needed. | 149 # If --build_dir is provided, prepend it to the test executable if needed. |
| 141 test_executable = options.test | 150 test_executable = options.test |
| 142 if options.build_dir and not test_executable.startswith(options.build_dir): | 151 if options.build_dir and not test_executable.startswith(options.build_dir): |
| 143 test_executable = os.path.join(options.build_dir, test_executable) | 152 test_executable = os.path.join(options.build_dir, test_executable) |
| 144 args = [test_executable] + args | 153 args = [test_executable] + args |
| 145 | 154 |
| 146 test = WebRTCTest(options.test, options, args, 'cmdline') | 155 test = WebRTCTest(options.test, options, args, 'cmdline') |
| 147 return test.Run() | 156 return test.Run() |
| 148 | 157 |
| 149 if __name__ == '__main__': | 158 if __name__ == '__main__': |
| 150 return_code = main(sys.argv) | 159 return_code = main(sys.argv) |
| 151 sys.exit(return_code) | 160 sys.exit(return_code) |
| OLD | NEW |