| 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 heapcheck_test.py. | 6 ''' Runs various chrome tests through heapcheck_test.py. |
| 7 | 7 |
| 8 Most of this code is copied from ../valgrind/chrome_tests.py. | 8 Most of this code is copied from ../valgrind/chrome_tests.py. |
| 9 TODO(glider): put common functions to a standalone module. | 9 TODO(glider): put common functions to a standalone module. |
| 10 ''' | 10 ''' |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 "net": self.TestNet, "net_unittests": self.TestNet, | 94 "net": self.TestNet, "net_unittests": self.TestNet, |
| 95 "printing": self.TestPrinting, "printing_unittests": self.TestPrinting, | 95 "printing": self.TestPrinting, "printing_unittests": self.TestPrinting, |
| 96 "remoting": self.TestRemoting, "remoting_unittests": self.TestRemoting, | 96 "remoting": self.TestRemoting, "remoting_unittests": self.TestRemoting, |
| 97 "sql": self.TestSql, "sql_unittests": self.TestSql, | 97 "sql": self.TestSql, "sql_unittests": self.TestSql, |
| 98 "startup": self.TestStartup, "startup_tests": self.TestStartup, | 98 "startup": self.TestStartup, "startup_tests": self.TestStartup, |
| 99 "sync": self.TestSync, "sync_unit_tests": self.TestSync, | 99 "sync": self.TestSync, "sync_unit_tests": self.TestSync, |
| 100 "test_shell": self.TestTestShell, "test_shell_tests": self.TestTestShell, | 100 "test_shell": self.TestTestShell, "test_shell_tests": self.TestTestShell, |
| 101 "ui_unit": self.TestUIUnit, "ui_unittests": self.TestUIUnit, | 101 "ui_unit": self.TestUIUnit, "ui_unittests": self.TestUIUnit, |
| 102 "unit": self.TestUnit, "unit_tests": self.TestUnit, | 102 "unit": self.TestUnit, "unit_tests": self.TestUnit, |
| 103 "views": self.TestViews, "views_unittests": self.TestViews, | 103 "views": self.TestViews, "views_unittests": self.TestViews, |
| 104 "gfx": self.TestGfx, "gfx_unittests": self.TestGfx, | |
| 105 } | 104 } |
| 106 | 105 |
| 107 if test not in self._test_list: | 106 if test not in self._test_list: |
| 108 raise TestNotFound("Unknown test: %s" % test) | 107 raise TestNotFound("Unknown test: %s" % test) |
| 109 | 108 |
| 110 self._options = options | 109 self._options = options |
| 111 self._args = args | 110 self._args = args |
| 112 self._test = test | 111 self._test = test |
| 113 | 112 |
| 114 script_dir = path_utils.ScriptDir() | 113 script_dir = path_utils.ScriptDir() |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 | 303 |
| 305 def TestUnit(self): | 304 def TestUnit(self): |
| 306 return self.SimpleTest("chrome", "unit_tests") | 305 return self.SimpleTest("chrome", "unit_tests") |
| 307 | 306 |
| 308 def TestSql(self): | 307 def TestSql(self): |
| 309 return self.SimpleTest("chrome", "sql_unittests") | 308 return self.SimpleTest("chrome", "sql_unittests") |
| 310 | 309 |
| 311 def TestViews(self): | 310 def TestViews(self): |
| 312 return self.SimpleTest("views", "views_unittests") | 311 return self.SimpleTest("views", "views_unittests") |
| 313 | 312 |
| 314 def TestGfx(self): | |
| 315 # Run ui_unittests, a successor of gfx_unittests, since gfx_unittests is | |
| 316 # deprecated. | |
| 317 # TODO(hbono): This is a band-aid fix. We need to change the master script | |
| 318 # so our bots run ui_unittests. | |
| 319 return self.SimpleTest("chrome", "ui_unittests") | |
| 320 | |
| 321 def TestLayoutChunk(self, chunk_num, chunk_size): | 313 def TestLayoutChunk(self, chunk_num, chunk_size): |
| 322 '''Runs tests [chunk_num*chunk_size .. (chunk_num+1)*chunk_size). | 314 '''Runs tests [chunk_num*chunk_size .. (chunk_num+1)*chunk_size). |
| 323 | 315 |
| 324 Wrap around to beginning of list at end. If chunk_size is zero, run all | 316 Wrap around to beginning of list at end. If chunk_size is zero, run all |
| 325 tests in the list once. If a text file is given as argument, it is used as | 317 tests in the list once. If a text file is given as argument, it is used as |
| 326 the list of tests. | 318 the list of tests. |
| 327 ''' | 319 ''' |
| 328 # Build the ginormous commandline in 'cmd'. | 320 # Build the ginormous commandline in 'cmd'. |
| 329 # It's going to be roughly | 321 # It's going to be roughly |
| 330 # python heapcheck_test.py ... python run_webkit_tests.py ... | 322 # python heapcheck_test.py ... python run_webkit_tests.py ... |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 for t in options.test: | 455 for t in options.test: |
| 464 tests = ChromeTests(options, args, t) | 456 tests = ChromeTests(options, args, t) |
| 465 ret = tests.Run() | 457 ret = tests.Run() |
| 466 if ret: | 458 if ret: |
| 467 return ret | 459 return ret |
| 468 return 0 | 460 return 0 |
| 469 | 461 |
| 470 | 462 |
| 471 if __name__ == "__main__": | 463 if __name__ == "__main__": |
| 472 sys.exit(main()) | 464 sys.exit(main()) |
| OLD | NEW |