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

Unified Diff: build/android/generate_emma_html.py

Issue 1711983002: Fix generate_emma_html.py failing due to 0-length .em files (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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: build/android/generate_emma_html.py
diff --git a/build/android/generate_emma_html.py b/build/android/generate_emma_html.py
index 64d834f3383a86dd1109755baaaada3727242532..9d1d7330b3600ef74e7e9e72a995db5497b2b9b2 100755
--- a/build/android/generate_emma_html.py
+++ b/build/android/generate_emma_html.py
@@ -58,6 +58,9 @@ def main():
coverage_files = _GetFilesWithExt(options.coverage_dir, 'ec')
metadata_files = _GetFilesWithExt(options.metadata_dir, 'em')
+ # Filter out zero-length files. These are created by emma_instr.py when a
+ # target has no classes matching the coverage filter.
+ metadata_files = [f for f in metadata_files if os.path.getsize(f)]
print 'Found coverage files: %s' % str(coverage_files)
print 'Found metadata files: %s' % str(metadata_files)
@@ -87,6 +90,10 @@ def main():
for f in coverage_files:
os.remove(f)
+ # Command tends to exit with status 0 when it actually failed.
+ if not exit_code and not os.path.exists(options.output):
+ exit_code = 1
+
return exit_code
« 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