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

Unified Diff: tools/coverity/coverity.py

Issue 2829003: Support OS X in coverity.py. Avoid echoing coverity password to console. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 10 years, 6 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/coverity/coverity.py
===================================================================
--- tools/coverity/coverity.py (revision 49812)
+++ tools/coverity/coverity.py (working copy)
@@ -84,9 +84,10 @@
pwfile.close()
return password.rstrip()
-def _RunCommand(cmd, dry_run, shell=False):
+def _RunCommand(cmd, dry_run, shell=False, echo_cmd=True):
"""Runs the command if dry_run is false, otherwise just prints the command."""
- print cmd
+ if echo_cmd:
+ print cmd
# TODO(wtc): Check the return value of subprocess.call, which is the return
# value of the command.
if not dry_run:
@@ -134,6 +135,8 @@
elif sys.platform == 'win32':
rm_path = os.path.join(options.source_dir,options.solution_dir,
options.target)
+ elif sys.platform == 'darwin':
+ rm_path = os.path.join(options.source_dir,'src','xcodebuild')
else:
print 'Platform "%s" unrecognized, don\'t know how to proceed'
_ReleaseLock(lock_file, lock_filename)
@@ -158,7 +161,16 @@
cmd = '%s\\cov-build.exe --dir %s devenv.com %s\\%s /build %s' % (
options.coverity_bin_dir, options.coverity_intermediate_dir,
options.source_dir, options.solution_file, options.target)
+ elif sys.platform == 'darwin':
+ use_shell_during_make = True
+ os.chdir('src/build')
+ _RunCommand('pwd', options.dry_run, shell=True)
+ cmd = ('%s/cov-build --dir %s xcodebuild -project all.xcodeproj '
+ '-configuration %s -target All') % (
+ options.coverity_bin_dir, options.coverity_intermediate_dir,
+ options.target)
+
_RunCommand(cmd, options.dry_run, shell=use_shell_during_make)
print 'Elapsed time: %ds' % (time.time() - start_time)
@@ -192,7 +204,8 @@
coverity_target,
options.coverity_user,
coverity_password)
- _RunCommand(cmd, options.dry_run, shell=use_shell_during_make)
+ # Avoid echoing the Commit command because it has a password in it
wtc 2010/06/15 22:04:07 Can we tell cov-commit-defects to read the passwor
+ _RunCommand(cmd, options.dry_run, shell=use_shell_during_make, echo_cmd=False)
print 'Total time: %ds' % (time.time() - start_time)
« 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