Improve AND check reports
authorAlexander Popov <alex.popov@linux.com>
Thu, 22 Oct 2020 16:59:00 +0000 (19:59 +0300)
committerAlexander Popov <alex.popov@linux.com>
Thu, 22 Oct 2020 16:59:00 +0000 (19:59 +0300)
kconfig_hardened_check/__init__.py

index 3e6e6096d036ae889f6afc05db8174e1b8a113e7..f82c07c45f3aa5f72e0d45dbdc7cfacfdbaf132e 100644 (file)
@@ -225,9 +225,11 @@ class AND(ComplexOptCheck):
             if not ret:
                 # This FAIL is caused by additional checks,
                 # and not by the main option that this AND-check is about.
-                if opt.result.startswith('FAIL: \"'):
-                    # Describe the reason of the FAIL.
+                # Describe the reason of the FAIL.
+                if opt.result.startswith('FAIL: \"') or opt.result == 'FAIL: not found':
                     self.result = 'FAIL: CONFIG_{} not "{}"'.format(opt.name, opt.expected)
+                elif opt.result == 'FAIL: not present':
+                    self.result = 'FAIL: CONFIG_{} not present'.format(opt.name)
                 else:
                     # This FAIL message is self-explaining.
                     self.result = opt.result