Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/env python | 1 #!/bin/env python |
| 2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 | 6 |
| 7 """Module to setup and generate code coverage data | 7 """Module to setup and generate code coverage data |
| 8 | 8 |
| 9 This module first sets up the environment for code coverage, instruments the | 9 This module first sets up the environment for code coverage, instruments the |
| 10 binaries, runs the tests and collects the code coverage data. | 10 binaries, runs the tests and collects the code coverage data. |
| 11 | 11 |
| 12 | 12 |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 | 231 |
| 232 # Stop the counters | 232 # Stop the counters |
| 233 counters_command = ('%s -shutdown' % | 233 counters_command = ('%s -shutdown' % |
| 234 (os.path.join(self.tools_path, 'vsperfcmd.exe'))) | 234 (os.path.join(self.tools_path, 'vsperfcmd.exe'))) |
| 235 (retcode, output) = proc.RunCommandFull(counters_command, | 235 (retcode, output) = proc.RunCommandFull(counters_command, |
| 236 collect_output=True) | 236 collect_output=True) |
| 237 logging.info('Counters shut down: %s' % (output)) | 237 logging.info('Counters shut down: %s' % (output)) |
| 238 # Return the intermediate .coverage file | 238 # Return the intermediate .coverage file |
| 239 return coverage_file | 239 return coverage_file |
| 240 | 240 |
| 241 | 241 |
|
Alexander Potapenko
2011/11/28 10:29:35
Please use 1 line between the class-level definiti
| |
| 242 def Upload(self, list_coverage, upload_path, sym_path=None, src_root=None): | 242 def Upload(self, list_coverage, upload_path, sym_path=None, src_root=None): |
| 243 """Upload the results to the dashboard. | 243 """Upload the results to the dashboard. |
| 244 | 244 |
| 245 This method uploads the coverage data to a dashboard where it will be | 245 This method uploads the coverage data to a dashboard where it will be |
| 246 processed. On Windows, this method will first convert the .coverage file to | 246 processed. On Windows, this method will first convert the .coverage file to |
| 247 the lcov format. This method needs to be called before the TearDown method. | 247 the lcov format. This method needs to be called before the TearDown method. |
| 248 | 248 |
| 249 Args: | 249 Args: |
| 250 list_coverage: The list of coverage data files to consoliate and upload. | 250 list_coverage: The list of coverage data files to consoliate and upload. |
| 251 upload_path: Destination where the coverage data will be processed. | 251 upload_path: Destination where the coverage data will be processed. |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 361 | 361 |
| 362 cov.Upload(list_coverage, | 362 cov.Upload(list_coverage, |
| 363 options.upload_path, | 363 options.upload_path, |
| 364 os.path.join(options.src_root, 'chrome', 'Release'), | 364 os.path.join(options.src_root, 'chrome', 'Release'), |
| 365 options.src_root) | 365 options.src_root) |
| 366 cov.TearDown() | 366 cov.TearDown() |
| 367 | 367 |
| 368 | 368 |
| 369 if __name__ == '__main__': | 369 if __name__ == '__main__': |
| 370 sys.exit(main()) | 370 sys.exit(main()) |
| OLD | NEW |