From aaa3826a9478d761aa7fcee62a9e54c4281f8a4e Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Fri, 20 Jul 2018 18:55:43 +0300 Subject: [PATCH] Use None as state of the options which are not found That will change the check result FAIL: "not found" onto initial FAIL: not found --- kconfig-hardened-check.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/kconfig-hardened-check.py b/kconfig-hardened-check.py index 3278376..a239836 100755 --- a/kconfig-hardened-check.py +++ b/kconfig-hardened-check.py @@ -36,11 +36,17 @@ class Opt: def check(self): global error_count - # check parsed state against expected state + if self.expected == self.state: return True, 'OK' - if self.expected == 'is not set' and self.state == 'not found': - return True, 'OK: not found' + + if self.state is None: + if self.expected == 'is not set': + return True, 'OK: not found' + else: + error_count += 1 + return False, 'FAIL: not found' + error_count += 1 return False, 'FAIL: "' + self.state + '"' @@ -173,7 +179,7 @@ def print_check_results(): def get_option_state(options, name): - return options[name] if name in options else 'not found' + return options[name] if name in options else None def check_state(options): -- 2.31.1