Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: tools/code_coverage/coverage_posix.py

Issue 11274053: Store coverage.info file in separate folders based on commandline parameters to coverage_posix.py. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/code_coverage/coverage_posix.py
===================================================================
--- tools/code_coverage/coverage_posix.py (revision 162133)
+++ tools/code_coverage/coverage_posix.py (working copy)
@@ -762,6 +762,12 @@
'--directory', self.directory_parent,
'--zerocounters'])
shutil.rmtree(os.path.join(self.directory, 'coverage'))
+ if self.options.all_unittests:
John Grabowski 2012/10/30 21:29:05 consider an unconditional delete. It is unclear w
pshenoy 2012/10/30 22:11:13 coverage_posix.py is run twice now. First time run
John Grabowski 2012/10/30 22:17:11 ok
+ if os.path.exists(os.path.join(self.directory, 'unittests_coverage')):
+ shutil.rmtree(os.path.join(self.directory, 'unittests_coverage'))
+ else:
+ if os.path.exists(os.path.join(self.directory, 'total_coverage')):
+ shutil.rmtree(os.path.join(self.directory, 'total_coverage'))
def BeforeRunOneTest(self, testname):
"""Do things before running each test."""
@@ -991,6 +997,22 @@
sys.exit(retcode)
if self.IsLinux():
os.chdir(start_dir)
+
+ # Copy the unittests coverage information to a different folder.
+ if self.options.all_unittests:
John Grabowski 2012/10/30 21:29:05 make the conditional set a var called filename (ei
pshenoy 2012/11/05 17:59:31 I think this is related to the other comment above
John Grabowski 2012/11/06 18:04:05 Sort of, but it would be nice to be pithy. For ex
pshenoy 2012/11/06 19:05:41 Done.
+ unittests_dir = os.path.join(self.directory, 'unittests_coverage')
+ if not os.path.exists(unittests_dir):
+ os.makedirs(unittests_dir)
+ shutil.copyfile(self.coverage_info_file, os.path.join(unittests_dir,
+ 'coverage.info'))
+ else:
+ # Save the overall coverage information.
+ overall_dir = os.path.join(self.directory, 'total_coverage')
+ if not os.path.exists(overall_dir):
+ os.makedirs(overall_dir)
+ shutil.copyfile(self.coverage_info_file, os.path.join(overall_dir,
+ 'coverage.info'))
+
if not os.path.exists(self.coverage_info_file):
logging.fatal('%s was not created. Coverage run failed.' %
self.coverage_info_file)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698