misra.py: updated -verify behaviour, print all errors seen and not just the first

This commit is contained in:
Daniel Marjamäki 2018-03-12 15:51:41 +01:00
parent a705391054
commit caf0789ab3
1 changed files with 4 additions and 2 deletions

View File

@ -1239,11 +1239,13 @@ for arg in sys.argv[1:]:
misra_21_11(cfg) misra_21_11(cfg)
if VERIFY: if VERIFY:
exitCode = 0
for expected in VERIFY_EXPECTED: for expected in VERIFY_EXPECTED:
if expected not in VERIFY_ACTUAL: if expected not in VERIFY_ACTUAL:
print('Expected but not seen: ' + expected) print('Expected but not seen: ' + expected)
sys.exit(1) exitCode = 1
for actual in VERIFY_ACTUAL: for actual in VERIFY_ACTUAL:
if actual not in VERIFY_EXPECTED: if actual not in VERIFY_EXPECTED:
print('Not expected: ' + actual) print('Not expected: ' + actual)
sys.exit(1) exitCode = 1
sys.exit(exitCode)