From df4dc540c6d5cdca7f23a192572b4ec3e1a0c07f Mon Sep 17 00:00:00 2001 From: Dobin Date: Mon, 13 Feb 2023 09:22:30 +0100 Subject: [PATCH] fix: more zero matches fixes --- avred.py | 2 +- verifier.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/avred.py b/avred.py index f40c304..6200e22 100755 --- a/avred.py +++ b/avred.py @@ -166,7 +166,7 @@ def scanFile(args, scanner): # convert IntervalTree Matches logging.info("Found {} matches".format(len(matchesIt))) if len(matchesIt) == 0: - logging.warn("No matches found. Try some other options?") + logging.warning("No matches found. Try some other options?") matches = convertMatchesIt(matchesIt) verification = None diff --git a/verifier.py b/verifier.py index 282a79a..98ab550 100644 --- a/verifier.py +++ b/verifier.py @@ -35,6 +35,9 @@ def verify(file, matches: List[Match], scanner) -> Verification: def verificationAnalyzer(verifications: List[VerificationEntry]) -> MatchConclusion: """Do some analysis on the verifications, and return the result""" verifyResults = [] + if len(verifications) == 0: + matchConclusions = MatchConclusion(verifyResults) + return matchConclusions matchCount = len(verifications[0].matchTests) @@ -111,6 +114,9 @@ def runVerifications(file, matches: List[Match], scanner) -> List[VerificationEn verificationRun.matchTests.append(toTestEntry('', result)) verificationRuns.append(verificationRun) + if len(matches) == 1: + return verificationRuns + # Incremental, Middle verificationRun = VerificationEntry( index=2,