OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 ''' Runs various chrome tests through valgrind_test.py.''' | 6 ''' Runs various chrome tests through valgrind_test.py.''' |
7 | 7 |
8 import glob | 8 import glob |
9 import logging | 9 import logging |
10 import optparse | 10 import optparse |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 316 |
317 def TestSql(self): | 317 def TestSql(self): |
318 return self.SimpleTest("chrome", "sql_unittests") | 318 return self.SimpleTest("chrome", "sql_unittests") |
319 | 319 |
320 def TestSync(self): | 320 def TestSync(self): |
321 return self.SimpleTest("chrome", "sync_unit_tests") | 321 return self.SimpleTest("chrome", "sync_unit_tests") |
322 | 322 |
323 def TestLinuxSandbox(self): | 323 def TestLinuxSandbox(self): |
324 return self.SimpleTest("sandbox", "sandbox_linux_unittests") | 324 return self.SimpleTest("sandbox", "sandbox_linux_unittests") |
325 | 325 |
326 def TestTestShell(self): | |
327 return self.SimpleTest("webkit", "test_shell_tests") | |
328 | |
329 def TestUnit(self): | 326 def TestUnit(self): |
330 # http://crbug.com/51716 | 327 # http://crbug.com/51716 |
331 # Disabling all unit tests | 328 # Disabling all unit tests |
332 # Problems reappeared after r119922 | 329 # Problems reappeared after r119922 |
333 if common.IsMac() and (self._options.valgrind_tool == "memcheck"): | 330 if common.IsMac() and (self._options.valgrind_tool == "memcheck"): |
334 logging.warning("unit_tests are disabled for memcheck on MacOS.") | 331 logging.warning("unit_tests are disabled for memcheck on MacOS.") |
335 return 0; | 332 return 0; |
336 return self.SimpleTest("chrome", "unit_tests") | 333 return self.SimpleTest("chrome", "unit_tests") |
337 | 334 |
338 def TestUIUnit(self): | 335 def TestUIUnit(self): |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 # to avoid valgrinding python. | 399 # to avoid valgrinding python. |
403 # Start by building the valgrind_test.py commandline. | 400 # Start by building the valgrind_test.py commandline. |
404 tool = valgrind_test.CreateTool(self._options.valgrind_tool) | 401 tool = valgrind_test.CreateTool(self._options.valgrind_tool) |
405 cmd = self._DefaultCommand(tool) | 402 cmd = self._DefaultCommand(tool) |
406 cmd.append("--trace_children") | 403 cmd.append("--trace_children") |
407 cmd.append("--indirect_webkit_layout") | 404 cmd.append("--indirect_webkit_layout") |
408 cmd.append("--ignore_exit_code") | 405 cmd.append("--ignore_exit_code") |
409 # Now build script_cmd, the run_webkits_tests.py commandline | 406 # Now build script_cmd, the run_webkits_tests.py commandline |
410 # Store each chunk in its own directory so that we can find the data later | 407 # Store each chunk in its own directory so that we can find the data later |
411 chunk_dir = os.path.join("layout", "chunk_%05d" % chunk_num) | 408 chunk_dir = os.path.join("layout", "chunk_%05d" % chunk_num) |
412 test_shell = os.path.join(self._options.build_dir, "test_shell") | |
413 out_dir = os.path.join(path_utils.ScriptDir(), "latest") | 409 out_dir = os.path.join(path_utils.ScriptDir(), "latest") |
414 out_dir = os.path.join(out_dir, chunk_dir) | 410 out_dir = os.path.join(out_dir, chunk_dir) |
415 if os.path.exists(out_dir): | 411 if os.path.exists(out_dir): |
416 old_files = glob.glob(os.path.join(out_dir, "*.txt")) | 412 old_files = glob.glob(os.path.join(out_dir, "*.txt")) |
417 for f in old_files: | 413 for f in old_files: |
418 os.remove(f) | 414 os.remove(f) |
419 else: | 415 else: |
420 os.makedirs(out_dir) | 416 os.makedirs(out_dir) |
421 script = os.path.join(self._source_dir, "webkit", "tools", "layout_tests", | 417 script = os.path.join(self._source_dir, "webkit", "tools", "layout_tests", |
422 "run_webkit_tests.py") | 418 "run_webkit_tests.py") |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 "ppapi": TestPPAPI, "ppapi_unittests": TestPPAPI, | 530 "ppapi": TestPPAPI, "ppapi_unittests": TestPPAPI, |
535 "printing": TestPrinting, "printing_unittests": TestPrinting, | 531 "printing": TestPrinting, "printing_unittests": TestPrinting, |
536 "reliability": TestReliability, "reliability_tests": TestReliability, | 532 "reliability": TestReliability, "reliability_tests": TestReliability, |
537 "remoting": TestRemoting, "remoting_unittests": TestRemoting, | 533 "remoting": TestRemoting, "remoting_unittests": TestRemoting, |
538 "safe_browsing": TestSafeBrowsing, "safe_browsing_tests": TestSafeBrowsing, | 534 "safe_browsing": TestSafeBrowsing, "safe_browsing_tests": TestSafeBrowsing, |
539 "sandbox": TestLinuxSandbox, "sandbox_linux_unittests": TestLinuxSandbox, | 535 "sandbox": TestLinuxSandbox, "sandbox_linux_unittests": TestLinuxSandbox, |
540 "sql": TestSql, "sql_unittests": TestSql, | 536 "sql": TestSql, "sql_unittests": TestSql, |
541 "sync": TestSync, "sync_unit_tests": TestSync, | 537 "sync": TestSync, "sync_unit_tests": TestSync, |
542 "sync_integration_tests": TestSyncIntegration, | 538 "sync_integration_tests": TestSyncIntegration, |
543 "sync_integration": TestSyncIntegration, | 539 "sync_integration": TestSyncIntegration, |
544 "test_shell": TestTestShell, "test_shell_tests": TestTestShell, | |
545 "ui_unit": TestUIUnit, "ui_unittests": TestUIUnit, | 540 "ui_unit": TestUIUnit, "ui_unittests": TestUIUnit, |
546 "unit": TestUnit, "unit_tests": TestUnit, | 541 "unit": TestUnit, "unit_tests": TestUnit, |
547 "views": TestViews, "views_unittests": TestViews, | 542 "views": TestViews, "views_unittests": TestViews, |
548 } | 543 } |
549 | 544 |
550 | 545 |
551 def _main(): | 546 def _main(): |
552 parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " | 547 parser = optparse.OptionParser("usage: %prog -b <dir> -t <test> " |
553 "[-t <test> ...]") | 548 "[-t <test> ...]") |
554 parser.disable_interspersed_args() | 549 parser.disable_interspersed_args() |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 | 598 |
604 for t in options.test: | 599 for t in options.test: |
605 tests = ChromeTests(options, args, t) | 600 tests = ChromeTests(options, args, t) |
606 ret = tests.Run() | 601 ret = tests.Run() |
607 if ret: return ret | 602 if ret: return ret |
608 return 0 | 603 return 0 |
609 | 604 |
610 | 605 |
611 if __name__ == "__main__": | 606 if __name__ == "__main__": |
612 sys.exit(_main()) | 607 sys.exit(_main()) |
OLD | NEW |