| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 ''' Runs various chrome tests through heapcheck_test.py. | 7 ''' Runs various chrome tests through heapcheck_test.py. |
| 8 | 8 |
| 9 Most of this code is copied from ../valgrind/chrome_tests.py. | 9 Most of this code is copied from ../valgrind/chrome_tests.py. |
| 10 TODO(glider): put common functions to a standalone module. | 10 TODO(glider): put common functions to a standalone module. |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 class ChromeTests(object): | 74 class ChromeTests(object): |
| 75 '''This class is derived from the chrome_tests.py file in ../purify/. | 75 '''This class is derived from the chrome_tests.py file in ../purify/. |
| 76 ''' | 76 ''' |
| 77 | 77 |
| 78 def __init__(self, options, args, test): | 78 def __init__(self, options, args, test): |
| 79 # The known list of tests. | 79 # The known list of tests. |
| 80 # Recognise the original abbreviations as well as full executable names. | 80 # Recognise the original abbreviations as well as full executable names. |
| 81 self._test_list = { | 81 self._test_list = { |
| 82 "base": self.TestBase, "base_unittests": self.TestBase, | 82 "base": self.TestBase, "base_unittests": self.TestBase, |
| 83 "browser": self.TestBrowser, "browser_tests": self.TestBrowser, | 83 "browser": self.TestBrowser, "browser_tests": self.TestBrowser, |
| 84 "crypto": self.TestCrypto, "crypto_unittests": self.TestCrypto, |
| 84 "googleurl": self.TestGURL, "googleurl_unittests": self.TestGURL, | 85 "googleurl": self.TestGURL, "googleurl_unittests": self.TestGURL, |
| 85 "courgette": self.TestCourgette, | 86 "courgette": self.TestCourgette, |
| 86 "courgette_unittests": self.TestCourgette, | 87 "courgette_unittests": self.TestCourgette, |
| 87 "ipc": self.TestIpc, "ipc_tests": self.TestIpc, | 88 "ipc": self.TestIpc, "ipc_tests": self.TestIpc, |
| 88 "layout": self.TestLayout, "layout_tests": self.TestLayout, | 89 "layout": self.TestLayout, "layout_tests": self.TestLayout, |
| 89 "media": self.TestMedia, "media_unittests": self.TestMedia, | 90 "media": self.TestMedia, "media_unittests": self.TestMedia, |
| 90 "net": self.TestNet, "net_unittests": self.TestNet, | 91 "net": self.TestNet, "net_unittests": self.TestNet, |
| 91 "printing": self.TestPrinting, "printing_unittests": self.TestPrinting, | 92 "printing": self.TestPrinting, "printing_unittests": self.TestPrinting, |
| 92 "remoting": self.TestRemoting, "remoting_unittests": self.TestRemoting, | 93 "remoting": self.TestRemoting, "remoting_unittests": self.TestRemoting, |
| 93 "startup": self.TestStartup, "startup_tests": self.TestStartup, | 94 "startup": self.TestStartup, "startup_tests": self.TestStartup, |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 else: | 248 else: |
| 248 os.putenv("LD_LIBRARY_PATH", self._options.build_dir) | 249 os.putenv("LD_LIBRARY_PATH", self._options.build_dir) |
| 249 return heapcheck_test.RunTool(cmd, supp, module) | 250 return heapcheck_test.RunTool(cmd, supp, module) |
| 250 | 251 |
| 251 def TestBase(self): | 252 def TestBase(self): |
| 252 return self.SimpleTest("base", "base_unittests") | 253 return self.SimpleTest("base", "base_unittests") |
| 253 | 254 |
| 254 def TestBrowser(self): | 255 def TestBrowser(self): |
| 255 return self.SimpleTest("chrome", "browser_tests") | 256 return self.SimpleTest("chrome", "browser_tests") |
| 256 | 257 |
| 258 def TestCrypto(self): |
| 259 return self.SimpleTest("crypto", "crypto_unittests") |
| 260 |
| 257 def TestGURL(self): | 261 def TestGURL(self): |
| 258 return self.SimpleTest("chrome", "googleurl_unittests") | 262 return self.SimpleTest("chrome", "googleurl_unittests") |
| 259 | 263 |
| 260 def TestCourgette(self): | 264 def TestCourgette(self): |
| 261 return self.SimpleTest("courgette", "courgette_unittests") | 265 return self.SimpleTest("courgette", "courgette_unittests") |
| 262 | 266 |
| 263 def TestMedia(self): | 267 def TestMedia(self): |
| 264 return self.SimpleTest("chrome", "media_unittests") | 268 return self.SimpleTest("chrome", "media_unittests") |
| 265 | 269 |
| 266 def TestPrinting(self): | 270 def TestPrinting(self): |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 return 0 | 457 return 0 |
| 454 | 458 |
| 455 | 459 |
| 456 if __name__ == "__main__": | 460 if __name__ == "__main__": |
| 457 if sys.platform == 'linux2': | 461 if sys.platform == 'linux2': |
| 458 ret = _main(sys.argv) | 462 ret = _main(sys.argv) |
| 459 else: | 463 else: |
| 460 logging.error("Heap checking works only on Linux at the moment.") | 464 logging.error("Heap checking works only on Linux at the moment.") |
| 461 ret = 1 | 465 ret = 1 |
| 462 sys.exit(ret) | 466 sys.exit(ret) |
| OLD | NEW |