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()) |