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

Unified Diff: tools/code_coverage/process_coverage.py

Issue 8678023: Fix python scripts in src/tools/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes Created 9 years, 1 month 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 | « tools/code_coverage/croc_test.py ('k') | tools/coverity/coverity.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/code_coverage/process_coverage.py
diff --git a/tools/code_coverage/process_coverage.py b/tools/code_coverage/process_coverage.py
old mode 100644
new mode 100755
index 8f6ccbf5a0a8d16feccca4126af3f812645f7dfe..07d83ac2c3562ab7f6ea21f1765fcc278da32df3
--- a/tools/code_coverage/process_coverage.py
+++ b/tools/code_coverage/process_coverage.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -345,9 +345,9 @@ def SendPost(req):
def main():
- if sys.platform[:5] != 'linux': # Run this only on Linux
+ if not sys.platform.startswith('linux'):
print 'This script is supported only on Linux'
- os.exit(1)
+ return 0
# Command line parsing
parser = optparse.OptionParser()
@@ -395,18 +395,19 @@ def main():
if percent == None:
# TODO(niranjan): Add logging.
print 'Failed to generate code coverage'
- os.exit(1)
+ return 1
else:
# TODO(niranjan): Do something with the code coverage numbers
pass
else:
print 'Unsupported platform'
- os.exit(1)
+ return 1
# Prep coverage results for dashboard and post new set.
parsed_data = ParseCoverageDataForDashboard(options.lcov_path)
PostResultsToDashboard(options.lcov_path, parsed_data, options.post_url)
+ return 0
if __name__ == '__main__':
- main()
+ sys.exit(main())
« no previous file with comments | « tools/code_coverage/croc_test.py ('k') | tools/coverity/coverity.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698