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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 help=('Store memory tool logs in the <tool>.logs directory ' | 116 help=('Store memory tool logs in the <tool>.logs directory ' |
117 'instead of /tmp.\nThis can be useful for tool ' | 117 'instead of /tmp.\nThis can be useful for tool ' |
118 'developers/maintainers.\nPlease note that the <tool>' | 118 'developers/maintainers.\nPlease note that the <tool>' |
119 '.logs directory will be clobbered on tool startup.')) | 119 '.logs directory will be clobbered on tool startup.')) |
120 parser.add_option("--test-launcher-bot-mode", action="store_true", | 120 parser.add_option("--test-launcher-bot-mode", action="store_true", |
121 help="run the tests with --test-launcher-bot-mode") | 121 help="run the tests with --test-launcher-bot-mode") |
122 parser.add_option("--test-launcher-total-shards", type=int, | 122 parser.add_option("--test-launcher-total-shards", type=int, |
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 parser.add_option("--drmemory_ops", | |
127 help="extra options passed to Dr. Memory") | |
128 options, args = parser.parse_args() | 126 options, args = parser.parse_args() |
129 | 127 |
130 if options.verbose: | 128 if options.verbose: |
131 logging_utils.config_root(logging.DEBUG) | 129 logging_utils.config_root(logging.DEBUG) |
132 else: | 130 else: |
133 logging_utils.config_root() | 131 logging_utils.config_root() |
134 | 132 |
135 if not options.test: | 133 if not options.test: |
136 parser.error('--test not specified') | 134 parser.error('--test not specified') |
137 | 135 |
138 # Support build dir both with and without the target. | 136 # Support build dir both with and without the target. |
139 if (options.target and options.build_dir and | 137 if (options.target and options.build_dir and |
140 not options.build_dir.endswith(options.target)): | 138 not options.build_dir.endswith(options.target)): |
141 options.build_dir = os.path.join(options.build_dir, options.target) | 139 options.build_dir = os.path.join(options.build_dir, options.target) |
142 | 140 |
143 # If --build_dir is provided, prepend it to the test executable if needed. | 141 # If --build_dir is provided, prepend it to the test executable if needed. |
144 test_executable = options.test | 142 test_executable = options.test |
145 if options.build_dir and not test_executable.startswith(options.build_dir): | 143 if options.build_dir and not test_executable.startswith(options.build_dir): |
146 test_executable = os.path.join(options.build_dir, test_executable) | 144 test_executable = os.path.join(options.build_dir, test_executable) |
147 args = [test_executable] + args | 145 args = [test_executable] + args |
148 | 146 |
149 test = WebRTCTest(options.test, options, args, 'cmdline') | 147 test = WebRTCTest(options.test, options, args, 'cmdline') |
150 return test.Run() | 148 return test.Run() |
151 | 149 |
152 if __name__ == '__main__': | 150 if __name__ == '__main__': |
153 return_code = main(sys.argv) | 151 return_code = main(sys.argv) |
154 sys.exit(return_code) | 152 sys.exit(return_code) |
OLD | NEW |