diff options
author | bevc@chromium.org <bevc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-16 17:42:52 +0000 |
---|---|---|
committer | bevc@chromium.org <bevc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-16 17:42:52 +0000 |
commit | bf2909231ccb210a5f2ec6c818ab32f9e52baa86 (patch) | |
tree | 9a309c2821e08f6fc0fed38818ae8768ca3c1106 /tools | |
parent | ce16e809676fe3dd03c6a4fcb99580c600ecb91c (diff) | |
download | chromium_src-bf2909231ccb210a5f2ec6c818ab32f9e52baa86.zip chromium_src-bf2909231ccb210a5f2ec6c818ab32f9e52baa86.tar.gz chromium_src-bf2909231ccb210a5f2ec6c818ab32f9e52baa86.tar.bz2 |
Support OS X in coverity.py. Avoid echoing coverity password to console.
Review URL: http://codereview.chromium.org/2829003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49976 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r-- | tools/coverity/coverity.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/tools/coverity/coverity.py b/tools/coverity/coverity.py index d7514ea..42e14c9 100644 --- a/tools/coverity/coverity.py +++ b/tools/coverity/coverity.py @@ -84,9 +84,10 @@ def _ReadPassword(pwfilename): 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 @@ def main(options, args): 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,6 +161,15 @@ def main(options, args): 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 @@ def main(options, args): 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 + _RunCommand(cmd, options.dry_run, shell=use_shell_during_make, echo_cmd=False) print 'Total time: %ds' % (time.time() - start_time) |