From 89f008927b90c6d8997416e766e7340c158093c3 Mon Sep 17 00:00:00 2001 From: "scherkus@chromium.org" Date: Thu, 5 Nov 2009 22:36:40 +0000 Subject: Remove verbosity from checkbins.py and print summary instead BUG=25952 TEST=no more verbosity! Review URL: http://codereview.chromium.org/368002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31150 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/checkbins/checkbins.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tools/checkbins/checkbins.py b/tools/checkbins/checkbins.py index 5d8ce53..05fc81f 100755 --- a/tools/checkbins/checkbins.py +++ b/tools/checkbins/checkbins.py @@ -29,13 +29,16 @@ def IsPEFile(path): def main(options, args): directory = args[0] - success = True + pe_total = 0 + pe_passed = 0 for file in os.listdir(directory): path = os.path.abspath(os.path.join(directory, file)) if not IsPEFile(path): continue pe = pefile.PE(path, fast_load=True) + pe_total = pe_total + 1 + success = True # Check for /DYNAMICBASE. if pe.OPTIONAL_HEADER.DllCharacteristics & DYNAMICBASE_FLAG: @@ -53,18 +56,20 @@ def main(options, args): success = False print "Checking %s for /NXCOMPAT... FAIL" % path - if not success: + # Update tally. + if success: + pe_passed = pe_passed + 1 + + print "Result: %d files found, %d files passed" % (pe_total, pe_passed) + if pe_passed != pe_total: # TODO(scherkus): change this back to 1 once I've fixed failing builds. sys.exit(0) if __name__ == '__main__': usage = "Usage: %prog [options] DIRECTORY" option_parser = optparse.OptionParser(usage=usage) - - # TODO(scherkus): change the default back to False once I've verified this - # tool actually does something on the bots. option_parser.add_option("-v", "--verbose", action="store_true", - default=True, help="Print debug logging") + default=False, help="Print debug logging") options, args = option_parser.parse_args() if not args: option_parser.print_help() -- cgit v1.1