mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 01:18:52 +08:00
Allow sym_diff.py to report non-zero for non-breaking ABI changes
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292297 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -30,6 +30,10 @@ def main():
|
||||
parser.add_argument('--only-stdlib-symbols', dest='only_stdlib',
|
||||
help="Filter all symbols not related to the stdlib",
|
||||
action='store_true', default=False)
|
||||
parser.add_argument('--strict', dest='strict',
|
||||
help="Exit with a non-zero status if any symbols "
|
||||
"differ",
|
||||
action='store_true', default=False)
|
||||
parser.add_argument(
|
||||
'-o', '--output', dest='output',
|
||||
help='The output file. stdout is used if not given',
|
||||
@@ -54,16 +58,16 @@ def main():
|
||||
added, removed, changed = diff.diff(old_syms_list, new_syms_list)
|
||||
if args.removed_only:
|
||||
added = {}
|
||||
report, is_break = diff.report_diff(added, removed, changed,
|
||||
names_only=args.names_only,
|
||||
demangle=args.demangle)
|
||||
report, is_break, is_different = diff.report_diff(
|
||||
added, removed, changed, names_only=args.names_only,
|
||||
demangle=args.demangle)
|
||||
if args.output is None:
|
||||
print(report)
|
||||
else:
|
||||
with open(args.output, 'w') as f:
|
||||
f.write(report + '\n')
|
||||
sys.exit(is_break)
|
||||
|
||||
exit_code = 1 if is_break or (args.strict and is_different) else 0
|
||||
sys.exit(exit_code)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
Reference in New Issue
Block a user