| 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. |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 help="run the tests with --test-launcher-total-shards") | 123 help="run the tests with --test-launcher-total-shards") |
| 124 parser.add_option("--test-launcher-shard-index", type=int, | 124 parser.add_option("--test-launcher-shard-index", type=int, |
| 125 help="run the tests with --test-launcher-shard-index") | 125 help="run the tests with --test-launcher-shard-index") |
| 126 options, args = parser.parse_args() | 126 options, args = parser.parse_args() |
| 127 | 127 |
| 128 ignore_parser = argparse.ArgumentParser() | 128 ignore_parser = argparse.ArgumentParser() |
| 129 # Ignore Chromium-specific flags | 129 # Ignore Chromium-specific flags |
| 130 # TODO(oprypin): Remove (bugs.webrtc.org/8115) | 130 # TODO(oprypin): Remove (bugs.webrtc.org/8115) |
| 131 ignore_parser.add_argument('--isolated-script-test-output', | 131 ignore_parser.add_argument('--isolated-script-test-output', |
| 132 type=str, default=None) | 132 type=str, default=None) |
| 133 ignore_parser.add_argument('--isolated-script-test-chartjson-output', | 133 ignore_parser.add_argument('--isolated-script-test-perf-output', |
| 134 type=str, default=None) | 134 type=str, default=None) |
| 135 _, args = ignore_parser.parse_known_args(args) | 135 _, args = ignore_parser.parse_known_args(args) |
| 136 | 136 |
| 137 if options.verbose: | 137 if options.verbose: |
| 138 logging_utils.config_root(logging.DEBUG) | 138 logging_utils.config_root(logging.DEBUG) |
| 139 else: | 139 else: |
| 140 logging_utils.config_root() | 140 logging_utils.config_root() |
| 141 | 141 |
| 142 if not options.test: | 142 if not options.test: |
| 143 parser.error('--test not specified') | 143 parser.error('--test not specified') |
| 144 | 144 |
| 145 # Support build dir both with and without the target. | 145 # Support build dir both with and without the target. |
| 146 if (options.target and options.build_dir and | 146 if (options.target and options.build_dir and |
| 147 not options.build_dir.endswith(options.target)): | 147 not options.build_dir.endswith(options.target)): |
| 148 options.build_dir = os.path.join(options.build_dir, options.target) | 148 options.build_dir = os.path.join(options.build_dir, options.target) |
| 149 | 149 |
| 150 # If --build_dir is provided, prepend it to the test executable if needed. | 150 # If --build_dir is provided, prepend it to the test executable if needed. |
| 151 test_executable = options.test | 151 test_executable = options.test |
| 152 if options.build_dir and not test_executable.startswith(options.build_dir): | 152 if options.build_dir and not test_executable.startswith(options.build_dir): |
| 153 test_executable = os.path.join(options.build_dir, test_executable) | 153 test_executable = os.path.join(options.build_dir, test_executable) |
| 154 args = [test_executable] + args | 154 args = [test_executable] + args |
| 155 | 155 |
| 156 test = WebRTCTest(options.test, options, args, 'cmdline') | 156 test = WebRTCTest(options.test, options, args, 'cmdline') |
| 157 return test.Run() | 157 return test.Run() |
| 158 | 158 |
| 159 if __name__ == '__main__': | 159 if __name__ == '__main__': |
| 160 return_code = main(sys.argv) | 160 return_code = main(sys.argv) |
| 161 sys.exit(return_code) | 161 sys.exit(return_code) |
| OLD | NEW |