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

Unified Diff: tools/checkbins/checkbins.py

Issue 1453293003: Add checkbins.py to Win builder on master.chromium. Implement JSON output. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sys.executable Created 5 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 | « testing/scripts/checkbins.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/checkbins/checkbins.py
diff --git a/tools/checkbins/checkbins.py b/tools/checkbins/checkbins.py
index 213f30a303b2a3e93ce7cda11be47f748360f4b8..9531f2421f48aa78e8e1636490f02cb375f9b694 100755
--- a/tools/checkbins/checkbins.py
+++ b/tools/checkbins/checkbins.py
@@ -10,6 +10,7 @@ In essense it runs a subset of BinScope tests ensuring that binaries have
/NXCOMPAT, /DYNAMICBASE and /SAFESEH.
"""
+import json
import os
import optparse
import sys
@@ -44,6 +45,8 @@ def main(options, args):
pe_total = 0
pe_passed = 0
+ failures = []
+
for file in os.listdir(directory):
path = os.path.abspath(os.path.join(directory, file))
if not IsPEFile(path):
@@ -103,8 +106,15 @@ def main(options, args):
# Update tally.
if success:
pe_passed = pe_passed + 1
+ else:
+ failures.append(path)
print "Result: %d files found, %d files passed" % (pe_total, pe_passed)
+
+ if options.json:
+ with open(options.json, 'w') as f:
+ json.dump(failures, f)
scottmg 2015/11/18 21:45:05 Is it useful to have something that's not an array
Paweł Hajdan Jr. 2015/11/19 11:27:29 Good question. The consumer of that is in the sam
+
if pe_passed != pe_total:
sys.exit(1)
@@ -113,6 +123,7 @@ if __name__ == '__main__':
option_parser = optparse.OptionParser(usage=usage)
option_parser.add_option("-v", "--verbose", action="store_true",
default=False, help="Print debug logging")
+ option_parser.add_option("--json", help="Path to JSON output file")
options, args = option_parser.parse_args()
if not args:
option_parser.print_help()
« no previous file with comments | « testing/scripts/checkbins.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698