Verify the modular stub flags are subsets of the monolithic stub flags
Bug: 179354495
Test: m out/soong/hiddenapi/hiddenapi-stub-flags.txt
- check that an error is reported if a modular stub-flags.csv file,
i.e. one created by a fragment is not a subset of the monolithic
file, e.g. because a signature in the modular file has different
flags than it does in the monolithic or is not present there.
Change-Id: I46ebb495cb093a5e3abe7571c49933c845318549
diff --git a/scripts/hiddenapi/verify_overlaps.py b/scripts/hiddenapi/verify_overlaps.py
index c8e3879..bb0917e 100755
--- a/scripts/hiddenapi/verify_overlaps.py
+++ b/scripts/hiddenapi/verify_overlaps.py
@@ -47,9 +47,9 @@
if signature in allFlagsBySignature:
allFlags = allFlagsBySignature.get(signature)
if allFlags != row:
- mismatchingSignatures.append((signature, row[None], allFlags[None]))
+ mismatchingSignatures.append((signature, row.get(None, []), allFlags.get(None, [])))
else:
- mismatchingSignatures.append((signature, row[None], []))
+ mismatchingSignatures.append((signature, row.get(None, []), []))
if mismatchingSignatures:
@@ -60,7 +60,7 @@
for mismatch in mismatchingSignatures:
print()
print("< " + mismatch[0] + "," + ",".join(mismatch[1]))
- if mismatch[2] != None:
+ if mismatch[2] != []:
print("> " + mismatch[0] + "," + ",".join(mismatch[2]))
else:
print("> " + mismatch[0] + " - missing")