From 4a0987242476561cd4e3157f9eb788568345901f Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Wed, 15 Jul 2020 16:12:54 +0300 Subject: [PATCH] Improve ComplexOptCheck use cases --- kconfig_hardened_check/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index 060b1de..635c927 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -178,9 +178,9 @@ class ComplexOptCheck: class OR(ComplexOptCheck): # self.opts[0] is the option that this OR-check is about. - # Use case: + # Use cases: # OR(, ) - # OR(, ) + # OR(, ) def check(self): if not self.opts: @@ -200,8 +200,10 @@ class OR(ComplexOptCheck): class AND(ComplexOptCheck): # self.opts[0] is the option that this AND-check is about. - # Use case: AND(, ) - # Suboption is not checked if checking of the main_option is failed. + # Use cases: + # AND(, ) + # Suboption is not checked if checking of the main_option is failed. + # AND(, ) def check(self): for i, opt in reversed(list(enumerate(self.opts))): @@ -211,7 +213,7 @@ class AND(ComplexOptCheck): return ret if not ret: if hasattr(opt, 'expected'): - self.result = 'FAIL: CONFIG_{} is needed'.format(opt.name) + self.result = 'FAIL: CONFIG_{} not "{}"'.format(opt.name, opt.expected) else: self.result = opt.result return False -- 2.31.1