OLD | NEW |
---|---|
1 #!/bin/env python | 1 #!/usr/bin/python |
2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # chrome_tests.py | 6 # chrome_tests.py |
7 | 7 |
8 ''' Runs various chrome tests through purify_test.py | 8 ''' Runs various chrome tests through valgrind_test.py. |
9 | |
10 This file is a copy of ../purify/chrome_tests.py. Eventually, it would be nice | |
11 to merge these two files. For now, I'm leaving it here with sections that | |
12 aren't supported commented out as this is more of a work in progress. | |
9 ''' | 13 ''' |
10 | 14 |
11 import glob | 15 import glob |
12 import logging | 16 import logging |
13 import optparse | 17 import optparse |
14 import os | 18 import os |
15 import stat | 19 import stat |
16 import sys | 20 import sys |
17 | 21 |
18 import google.logging_utils | 22 import google.logging_utils |
19 import google.path_utils | 23 import google.path_utils |
20 import google.platform_utils | 24 import platform_utils |
21 | 25 |
22 import common | 26 import common |
23 | 27 |
24 | 28 |
25 class TestNotFound(Exception): pass | 29 class TestNotFound(Exception): pass |
26 | 30 |
27 | 31 |
28 class ChromeTests: | 32 class ChromeTests: |
33 '''This class is derived from the chrome_tests.py file in ../purify/. I've | |
34 commented out all the parts that I don't have working yet or are irrelevant. | |
35 ''' | |
29 | 36 |
30 def __init__(self, options, args, test): | 37 def __init__(self, options, args, test): |
31 # the known list of tests | 38 # the known list of tests |
32 self._test_list = {"test_shell": self.TestTestShell, | 39 self._test_list = { |
33 "unit": self.TestUnit, | 40 # "test_shell": self.TestTestShell, |
34 "net": self.TestNet, | 41 "unit": self.TestUnit, |
35 "ipc": self.TestIpc, | 42 "net": self.TestNet, |
36 "base": self.TestBase, | 43 "ipc": self.TestIpc, |
37 "layout": self.TestLayout, | 44 "base": self.TestBase, |
38 "dll": self.TestDll, | 45 # "layout": self.TestLayout, |
39 "layout_all": self.TestLayoutAll, | 46 # "dll": self.TestDll, |
40 "ui": self.TestUI} | 47 # "layout_all": self.TestLayoutAll, |
48 # "ui": self.TestUI | |
49 } | |
41 | 50 |
42 if test not in self._test_list: | 51 if test not in self._test_list: |
43 raise TestNotFound("Unknown test: %s" % test) | 52 raise TestNotFound("Unknown test: %s" % test) |
44 | 53 |
45 self._options = options | 54 self._options = options |
46 self._args = args | 55 self._args = args |
47 self._test = test | 56 self._test = test |
48 | 57 |
49 script_dir = google.path_utils.ScriptDir() | 58 script_dir = google.path_utils.ScriptDir() |
50 utility = google.platform_utils.PlatformUtility(script_dir) | 59 utility = platform_utils.PlatformUtility(script_dir) |
51 # Compute the top of the tree (the "source dir") from the script dir (where | 60 # Compute the top of the tree (the "source dir") from the script dir (where |
52 # this script lives). We assume that the script dir is in tools/purify | 61 # this script lives). We assume that the script dir is in tools/valgrind/ |
53 # relative to the top of the tree. | 62 # relative to the top of the tree. |
54 self._source_dir = os.path.dirname(os.path.dirname(script_dir)) | 63 self._source_dir = os.path.dirname(os.path.dirname(script_dir)) |
55 # since this path is used for string matching, make sure it's always | 64 # since this path is used for string matching, make sure it's always |
56 # an absolute Windows-style path | 65 # an absolute Windows-style path |
57 self._source_dir = utility.GetAbsolutePath(self._source_dir) | 66 self._source_dir = utility.GetAbsolutePath(self._source_dir) |
58 purify_test = os.path.join(script_dir, "purify_test.py") | 67 valgrind_test = os.path.join(script_dir, "valgrind_test.py") |
59 self._command_preamble = ["python.exe", purify_test, "--echo_to_stdout", | 68 self._command_preamble = ["python", valgrind_test, "--echo_to_stdout", |
60 "--source_dir=%s" % (self._source_dir), | 69 "--source_dir=%s" % (self._source_dir)] |
61 "--save_cache"] | |
62 | 70 |
63 def _DefaultCommand(self, module, exe=None): | 71 def _DefaultCommand(self, module, exe=None): |
64 '''Generates the default command array that most tests will use.''' | 72 '''Generates the default command array that most tests will use.''' |
65 module_dir = os.path.join(self._source_dir, module) | 73 module_dir = os.path.join(self._source_dir, module) |
66 if module == "chrome": | 74 |
67 # unfortunately, not all modules have the same directory structure | 75 self._data_dir = "." |
Erik does not do reviews
2009/01/08 21:28:25
You probably want to use the mechanism I used here
| |
68 self._data_dir = os.path.join(module_dir, "test", "data", "purify") | 76 |
69 else: | |
70 self._data_dir = os.path.join(module_dir, "data", "purify") | |
71 if not self._options.build_dir: | 77 if not self._options.build_dir: |
72 dir_chrome = os.path.join(self._source_dir, "chrome", "Release") | 78 dir_chrome = os.path.join(self._source_dir, "chrome", "Hammer") |
73 dir_module = os.path.join(module_dir, "Release") | 79 dir_module = os.path.join(module_dir, "Hammer") |
74 if exe: | 80 if exe: |
75 exe_chrome = os.path.join(dir_chrome, exe) | 81 exe_chrome = os.path.join(dir_chrome, exe) |
76 exe_module = os.path.join(dir_module, exe) | 82 exe_module = os.path.join(dir_module, exe) |
77 if os.path.isfile(exe_chrome) and not os.path.isfile(exe_module): | 83 if os.path.isfile(exe_chrome) and not os.path.isfile(exe_module): |
78 self._options.build_dir = dir_chrome | 84 self._options.build_dir = dir_chrome |
79 elif os.path.isfile(exe_module) and not os.path.isfile(exe_chrome): | 85 elif os.path.isfile(exe_module) and not os.path.isfile(exe_chrome): |
80 self._options.build_dir = dir_module | 86 self._options.build_dir = dir_module |
81 elif os.stat(exe_module)[stat.ST_MTIME] > os.stat(exe_chrome)[stat.ST_MT IME]: | 87 elif os.stat(exe_module)[stat.ST_MTIME] > os.stat(exe_chrome)[stat.ST_MT IME]: |
82 self._options.build_dir = dir_module | 88 self._options.build_dir = dir_module |
83 else: | 89 else: |
84 self._options.build_dir = dir_chrome | 90 self._options.build_dir = dir_chrome |
85 else: | 91 else: |
86 if os.path.isdir(dir_chrome) and not os.path.isdir(dir_module): | 92 if os.path.isdir(dir_chrome) and not os.path.isdir(dir_module): |
87 self._options.build_dir = dir_chrome | 93 self._options.build_dir = dir_chrome |
88 elif os.path.isdir(dir_module) and not os.path.isdir(dir_chrome): | 94 elif os.path.isdir(dir_module) and not os.path.isdir(dir_chrome): |
89 self._options.build_dir = dir_module | 95 self._options.build_dir = dir_module |
90 elif os.stat(dir_module)[stat.ST_MTIME] > os.stat(dir_chrome)[stat.ST_MT IME]: | 96 elif os.stat(dir_module)[stat.ST_MTIME] > os.stat(dir_chrome)[stat.ST_MT IME]: |
91 self._options.build_dir = dir_module | 97 self._options.build_dir = dir_module |
92 else: | 98 else: |
93 self._options.build_dir = dir_chrome | 99 self._options.build_dir = dir_chrome |
94 | 100 |
95 cmd = list(self._command_preamble) | 101 cmd = list(self._command_preamble) |
96 cmd.append("--data_dir=%s" % self._data_dir) | 102 cmd.append("--data_dir=%s" % self._data_dir) |
97 if self._options.baseline: | 103 if self._options.baseline: |
98 cmd.append("--baseline") | 104 cmd.append("--baseline") |
99 if self._options.verbose: | 105 if self._options.verbose: |
100 cmd.append("--verbose") | 106 cmd.append("--verbose") |
107 if self._options.generate_suppressions: | |
108 cmd.append("--generate_suppressions") | |
101 if exe: | 109 if exe: |
102 cmd.append(os.path.join(self._options.build_dir, exe)) | 110 cmd.append(os.path.join(self._options.build_dir, exe)) |
103 return cmd | 111 return cmd |
104 | 112 |
105 def Run(self): | 113 def Run(self): |
106 ''' Runs the test specified by command-line argument --test ''' | 114 ''' Runs the test specified by command-line argument --test ''' |
107 logging.info("running test %s" % (self._test)) | 115 logging.info("running test %s" % (self._test)) |
108 return self._test_list[self._test]() | 116 return self._test_list[self._test]() |
109 | 117 |
110 def _ReadGtestFilterFile(self, name, cmd): | 118 def _ReadGtestFilterFile(self, name, cmd): |
(...skipping 21 matching lines...) Expand all Loading... | |
132 if gtest_filter: | 140 if gtest_filter: |
133 cmd.append("--gtest_filter=%s" % gtest_filter) | 141 cmd.append("--gtest_filter=%s" % gtest_filter) |
134 | 142 |
135 def SimpleTest(self, module, name): | 143 def SimpleTest(self, module, name): |
136 cmd = self._DefaultCommand(module, name) | 144 cmd = self._DefaultCommand(module, name) |
137 self._ReadGtestFilterFile(name, cmd) | 145 self._ReadGtestFilterFile(name, cmd) |
138 return common.RunSubprocess(cmd, 0) | 146 return common.RunSubprocess(cmd, 0) |
139 | 147 |
140 def ScriptedTest(self, module, exe, name, script, multi=False, cmd_args=None, | 148 def ScriptedTest(self, module, exe, name, script, multi=False, cmd_args=None, |
141 out_dir_extra=None): | 149 out_dir_extra=None): |
142 '''Purify a target exe, which will be executed one or more times via a | 150 '''Valgrind a target binary, which will be executed one or more times via a |
143 script or driver program. | 151 script or driver program. |
144 Args: | 152 Args: |
145 module - which top level component this test is from (webkit, base, etc.) | 153 module - which top level component this test is from (webkit, base, etc.) |
146 exe - the name of the exe (it's assumed to exist in build_dir) | 154 exe - the name of the exe (it's assumed to exist in build_dir) |
147 name - the name of this test (used to name output files) | 155 name - the name of this test (used to name output files) |
148 script - the driver program or script. If it's python.exe, we use | 156 script - the driver program or script. If it's python.exe, we use |
149 search-path behavior to execute, otherwise we assume that it is in | 157 search-path behavior to execute, otherwise we assume that it is in |
150 build_dir. | 158 build_dir. |
151 multi - a boolean hint that the exe will be run multiple times, generating | 159 multi - a boolean hint that the exe will be run multiple times, generating |
152 multiple output files (without this option, only the last run will be | 160 multiple output files (without this option, only the last run will be |
153 recorded and analyzed) | 161 recorded and analyzed) |
154 cmd_args - extra arguments to pass to the purify_test.py script | 162 cmd_args - extra arguments to pass to the valgrind_test.py script |
155 ''' | 163 ''' |
156 cmd = self._DefaultCommand(module) | 164 cmd = self._DefaultCommand(module) |
157 exe = os.path.join(self._options.build_dir, exe) | 165 exe = os.path.join(self._options.build_dir, exe) |
158 cmd.append("--exe=%s" % exe) | 166 cmd.append("--exe=%s" % exe) |
159 cmd.append("--name=%s" % name) | 167 cmd.append("--name=%s" % name) |
160 if multi: | 168 if multi: |
161 out = os.path.join(google.path_utils.ScriptDir(), | 169 out = os.path.join(google.path_utils.ScriptDir(), |
162 "latest") | 170 "latest") |
163 if out_dir_extra: | 171 if out_dir_extra: |
164 out = os.path.join(out, out_dir_extra) | 172 out = os.path.join(out, out_dir_extra) |
165 if os.path.exists(out): | 173 if os.path.exists(out): |
166 old_files = glob.glob(os.path.join(out, "*.txt")) | 174 old_files = glob.glob(os.path.join(out, "*.txt")) |
167 for f in old_files: | 175 for f in old_files: |
168 os.remove(f) | 176 os.remove(f) |
169 else: | 177 else: |
170 os.makedirs(out) | 178 os.makedirs(out) |
171 out = os.path.join(out, "%s%%5d.txt" % name) | 179 out = os.path.join(out, "%s%%5d.txt" % name) |
172 cmd.append("--out_file=%s" % out) | 180 cmd.append("--out_file=%s" % out) |
173 if cmd_args: | 181 if cmd_args: |
174 cmd.extend(cmd_args) | 182 cmd.extend(cmd_args) |
175 if script[0] != "python.exe" and not os.path.exists(script[0]): | 183 if script[0] != "python.exe" and not os.path.exists(script[0]): |
176 script[0] = os.path.join(self._options.build_dir, script[0]) | 184 script[0] = os.path.join(self._options.build_dir, script[0]) |
177 cmd.extend(script) | 185 cmd.extend(script) |
178 self._ReadGtestFilterFile(name, cmd) | 186 self._ReadGtestFilterFile(name, cmd) |
179 return common.RunSubprocess(cmd, 0) | 187 return common.RunSubprocess(cmd, 0) |
180 | 188 |
181 def InstrumentDll(self): | 189 # def InstrumentDll(self): |
182 '''Does a blocking Purify instrumentation of chrome.dll.''' | 190 # '''Does a blocking Purify instrumentation of chrome.dll.''' |
183 # TODO(paulg): Make this code support any DLL. | 191 # # TODO(paulg): Make this code support any DLL. |
184 cmd = self._DefaultCommand("chrome") | 192 # cmd = self._DefaultCommand("chrome") |
185 cmd.append("--instrument_only") | 193 # cmd.append("--instrument_only") |
186 cmd.append(os.path.join(self._options.build_dir, "chrome.dll")) | 194 # cmd.append(os.path.join(self._options.build_dir, "chrome.dll")) |
187 result = common.RunSubprocess(cmd, 0) | 195 # result = common.RunSubprocess(cmd, 0) |
188 if result: | 196 # if result: |
189 logging.error("Instrumentation error: %d" % result) | 197 # logging.error("Instrumentation error: %d" % result) |
190 return result | 198 # return result |
191 | 199 |
192 def TestDll(self): | 200 # def TestDll(self): |
193 return self.InstrumentDll() | 201 # return self.InstrumentDll() |
194 | 202 |
195 def TestBase(self): | 203 def TestBase(self): |
196 return self.SimpleTest("base", "base_unittests.exe") | 204 return self.SimpleTest("base", "base_unittests") |
197 | 205 |
198 def TestIpc(self): | 206 def TestIpc(self): |
199 return self.SimpleTest("chrome", "ipc_tests.exe") | 207 return self.SimpleTest("chrome", "ipc_tests") |
200 | 208 |
201 def TestNet(self): | 209 def TestNet(self): |
202 return self.SimpleTest("net", "net_unittests.exe") | 210 return self.SimpleTest("net", "net_unittests") |
203 | 211 |
204 def TestTestShell(self): | 212 def TestTestShell(self): |
205 return self.SimpleTest("webkit", "test_shell_tests.exe") | 213 return self.SimpleTest("webkit", "test_shell_tests") |
206 | 214 |
207 def TestUnit(self): | 215 def TestUnit(self): |
208 return self.SimpleTest("chrome", "unit_tests.exe") | 216 return self.SimpleTest("chrome", "unit_tests") |
209 | 217 |
210 def TestLayoutAll(self): | 218 # def TestLayoutAll(self): |
211 return self.TestLayout(run_all=True) | 219 # return self.TestLayout(run_all=True) |
212 | 220 |
213 def TestLayout(self, run_all=False): | 221 # def TestLayout(self, run_all=False): |
214 # A "chunk file" is maintained in the local directory so that each test | 222 # # A "chunk file" is maintained in the local directory so that each test |
215 # runs a slice of the layout tests of size chunk_size that increments with | 223 # # runs a slice of the layout tests of size chunk_size that increments with |
216 # each run. Since tests can be added and removed from the layout tests at | 224 # # each run. Since tests can be added and removed from the layout tests at |
217 # any time, this is not going to give exact coverage, but it will allow us | 225 # # any time, this is not going to give exact coverage, but it will allow us |
218 # to continuously run small slices of the layout tests under purify rather | 226 # # to continuously run small slices of the layout tests under purify rather |
219 # than having to run all of them in one shot. | 227 # # than having to run all of them in one shot. |
220 chunk_num = 0 | 228 # chunk_num = 0 |
221 # Tests currently seem to take about 20-30s each. | 229 # # Tests currently seem to take about 20-30s each. |
222 chunk_size = 120 # so about 40-60 minutes per run | 230 # chunk_size = 120 # so about 40-60 minutes per run |
223 chunk_file = os.path.join(os.environ["TEMP"], "purify_layout_chunk.txt") | 231 # chunk_file = os.path.join(os.environ["TEMP"], "purify_layout_chunk.txt") |
224 if not run_all: | 232 # if not run_all: |
225 try: | 233 # try: |
226 f = open(chunk_file) | 234 # f = open(chunk_file) |
227 if f: | 235 # if f: |
228 str = f.read() | 236 # str = f.read() |
229 if len(str): | 237 # if len(str): |
230 chunk_num = int(str) | 238 # chunk_num = int(str) |
231 # This should be enough so that we have a couple of complete runs | 239 # # This should be enough so that we have a couple of complete runs |
232 # of test data stored in the archive (although note that when we loop | 240 # # of test data stored in the archive (although note that when we loo p |
233 # that we almost guaranteed won't be at the end of the test list) | 241 # # that we almost guaranteed won't be at the end of the test list) |
234 if chunk_num > 10000: | 242 # if chunk_num > 10000: |
235 chunk_num = 0 | 243 # chunk_num = 0 |
236 f.close() | 244 # f.close() |
237 except IOError, (errno, strerror): | 245 # except IOError, (errno, strerror): |
238 logging.error("error reading from file %s (%d, %s)" % (chunk_file, | 246 # logging.error("error reading from file %s (%d, %s)" % (chunk_file, |
239 errno, strerror)) | 247 # errno, strerror)) |
240 | 248 |
241 script = os.path.join(self._source_dir, "webkit", "tools", "layout_tests", | 249 # script = os.path.join(self._source_dir, "webkit", "tools", "layout_tests", |
242 "run_webkit_tests.py") | 250 # "run_webkit_tests.py") |
243 script_cmd = ["python.exe", script, "--run-singly", "-v", | 251 # script_cmd = ["python.exe", script, "--run-singly", "-v", |
244 "--noshow-results", "--time-out-ms=200000", | 252 # "--noshow-results", "--time-out-ms=200000", |
245 "--nocheck-sys-deps"] | 253 # "--nocheck-sys-deps"] |
246 if not run_all: | 254 # if not run_all: |
247 script_cmd.append("--run-chunk=%d:%d" % (chunk_num, chunk_size)) | 255 # script_cmd.append("--run-chunk=%d:%d" % (chunk_num, chunk_size)) |
248 | 256 |
249 if len(self._args): | 257 # if len(self._args): |
250 # if the arg is a txt file, then treat it as a list of tests | 258 # # if the arg is a txt file, then treat it as a list of tests |
251 if os.path.isfile(self._args[0]) and self._args[0][-4:] == ".txt": | 259 # if os.path.isfile(self._args[0]) and self._args[0][-4:] == ".txt": |
252 script_cmd.append("--test-list=%s" % self._args[0]) | 260 # script_cmd.append("--test-list=%s" % self._args[0]) |
253 else: | 261 # else: |
254 script_cmd.extend(self._args) | 262 # script_cmd.extend(self._args) |
255 | 263 |
256 if run_all: | 264 # if run_all: |
257 ret = self.ScriptedTest("webkit", "test_shell.exe", "layout", | 265 # ret = self.ScriptedTest("webkit", "test_shell.exe", "layout", |
258 script_cmd, multi=True, cmd_args=["--timeout=0"]) | 266 # script_cmd, multi=True, cmd_args=["--timeout=0"] ) |
259 return ret | 267 # return ret |
260 | 268 |
261 # store each chunk in its own directory so that we can find the data later | 269 # # store each chunk in its own directory so that we can find the data later |
262 chunk_dir = os.path.join("layout", "chunk_%05d" % chunk_num) | 270 # chunk_dir = os.path.join("layout", "chunk_%05d" % chunk_num) |
263 ret = self.ScriptedTest("webkit", "test_shell.exe", "layout", | 271 # ret = self.ScriptedTest("webkit", "test_shell.exe", "layout", |
264 script_cmd, multi=True, cmd_args=["--timeout=0"], | 272 # script_cmd, multi=True, cmd_args=["--timeout=0"], |
265 out_dir_extra=chunk_dir) | 273 # out_dir_extra=chunk_dir) |
266 | 274 |
267 # Wait until after the test runs to completion to write out the new chunk | 275 # # Wait until after the test runs to completion to write out the new chunk |
268 # number. This way, if the bot is killed, we'll start running again from | 276 # # number. This way, if the bot is killed, we'll start running again from |
269 # the current chunk rather than skipping it. | 277 # # the current chunk rather than skipping it. |
270 try: | 278 # try: |
271 f = open(chunk_file, "w") | 279 # f = open(chunk_file, "w") |
272 chunk_num += 1 | 280 # chunk_num += 1 |
273 f.write("%d" % chunk_num) | 281 # f.write("%d" % chunk_num) |
274 f.close() | 282 # f.close() |
275 except IOError, (errno, strerror): | 283 # except IOError, (errno, strerror): |
276 logging.error("error writing to file %s (%d, %s)" % (chunk_file, errno, | 284 # logging.error("error writing to file %s (%d, %s)" % (chunk_file, errno, |
277 strerror)) | 285 # strerror)) |
278 # Since we're running small chunks of the layout tests, it's important to | 286 # # Since we're running small chunks of the layout tests, it's important to |
279 # mark the ones that have errors in them. These won't be visible in the | 287 # # mark the ones that have errors in them. These won't be visible in the |
280 # summary list for long, but will be useful for someone reviewing this bot. | 288 # # summary list for long, but will be useful for someone reviewing this bot . |
281 return ret | 289 # return ret |
282 | 290 |
283 def TestUI(self): | 291 # def TestUI(self): |
284 if not self._options.no_reinstrument: | 292 # if not self._options.no_reinstrument: |
285 instrumentation_error = self.InstrumentDll() | 293 # instrumentation_error = self.InstrumentDll() |
286 if instrumentation_error: | 294 # if instrumentation_error: |
287 return instrumentation_error | 295 # return instrumentation_error |
288 return self.ScriptedTest("chrome", "chrome.exe", "ui_tests", | 296 # return self.ScriptedTest("chrome", "chrome.exe", "ui_tests", |
289 ["ui_tests.exe", | 297 # ["ui_tests.exe", |
290 "--single-process", | 298 # "--single-process", |
291 "--ui-test-timeout=180000", | 299 # "--ui-test-timeout=120000", |
292 "--ui-test-action-timeout=80000", | 300 # "--ui-test-action-timeout=80000", |
293 "--ui-test-action-max-timeout=180000"], | 301 # "--ui-test-action-max-timeout=180000"], |
294 multi=True) | 302 # multi=True) |
295 | 303 |
296 | 304 |
297 def _main(argv): | 305 def _main(argv): |
298 parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " | 306 parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " |
299 "[-t <test> ...]") | 307 "[-t <test> ...]") |
300 parser.disable_interspersed_args() | 308 parser.disable_interspersed_args() |
301 parser.add_option("-b", "--build_dir", | 309 parser.add_option("-b", "--build_dir", |
302 help="the location of the output of the compiler output") | 310 help="the location of the output of the compiler output") |
303 parser.add_option("-t", "--test", action="append", | 311 parser.add_option("-t", "--test", action="append", |
304 help="which test to run") | 312 help="which test to run") |
305 parser.add_option("", "--baseline", action="store_true", default=False, | 313 parser.add_option("", "--baseline", action="store_true", default=False, |
306 help="generate baseline data instead of validating") | 314 help="generate baseline data instead of validating") |
307 parser.add_option("", "--gtest_filter", | 315 parser.add_option("", "--gtest_filter", |
308 help="additional arguments to --gtest_filter") | 316 help="additional arguments to --gtest_filter") |
309 parser.add_option("-v", "--verbose", action="store_true", default=False, | 317 parser.add_option("-v", "--verbose", action="store_true", default=False, |
310 help="verbose output - enable debug log messages") | 318 help="verbose output - enable debug log messages") |
311 parser.add_option("", "--no-reinstrument", action="store_true", default=False, | 319 parser.add_option("", "--no-reinstrument", action="store_true", default=False, |
312 help="Don't force a re-instrumentation for ui_tests") | 320 help="Don't force a re-instrumentation for ui_tests") |
321 parser.add_option("", "--generate_suppressions", action="store_true", | |
322 default=False, | |
323 help="Skip analysis and generate suppressions") | |
324 | |
313 options, args = parser.parse_args() | 325 options, args = parser.parse_args() |
314 | 326 |
315 if options.verbose: | 327 if options.verbose: |
316 google.logging_utils.config_root(logging.DEBUG) | 328 google.logging_utils.config_root(logging.DEBUG) |
317 else: | 329 else: |
318 google.logging_utils.config_root() | 330 google.logging_utils.config_root() |
319 | 331 |
320 if not options.test or not len(options.test): | 332 if not options.test or not len(options.test): |
321 parser.error("--test not specified") | 333 parser.error("--test not specified") |
322 | 334 |
323 for t in options.test: | 335 for t in options.test: |
324 tests = ChromeTests(options, args, t) | 336 tests = ChromeTests(options, args, t) |
325 ret = tests.Run() | 337 ret = tests.Run() |
326 if ret: return ret | 338 if ret: return ret |
327 return 0 | 339 return 0 |
328 | 340 |
329 | 341 |
330 if __name__ == "__main__": | 342 if __name__ == "__main__": |
331 ret = _main(sys.argv) | 343 ret = _main(sys.argv) |
332 sys.exit(ret) | 344 sys.exit(ret) |
333 | 345 |
OLD | NEW |