projects
/
kconfig-hardened-check.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3ff6e74
)
Turn some error conditions into assertions (part 2)
author
Alexander Popov
<alex.popov@linux.com>
Wed, 8 Jun 2022 21:24:36 +0000
(
00:24
+0300)
committer
Alexander Popov
<alex.popov@linux.com>
Wed, 8 Jun 2022 21:24:36 +0000
(
00:24
+0300)
kconfig_hardened_check/__init__.py
patch
|
blob
|
history
diff --git
a/kconfig_hardened_check/__init__.py
b/kconfig_hardened_check/__init__.py
index 45bd9d5c49110a61999e2a43fae4c33bf78d5c5f..635397ea6aadbd3747bb5f8f9af5f42097981ae2 100644
(file)
--- a/
kconfig_hardened_check/__init__.py
+++ b/
kconfig_hardened_check/__init__.py
@@
-252,9
+252,10
@@
class OR(ComplexOptCheck):
self.result = 'OK: {} not found'.format(opt.name)
elif opt.result == 'OK: is present':
self.result = 'OK: {} is present'.format(opt.name)
self.result = 'OK: {} not found'.format(opt.name)
elif opt.result == 'OK: is present':
self.result = 'OK: {} is present'.format(opt.name)
- # VersionCheck provides enough info
- elif not opt.result.startswith('OK: version'):
- sys.exit('[!] ERROR: unexpected OK description "{}"'.format(opt.result))
+ else:
+ # VersionCheck provides enough info
+ assert(opt.result.startswith('OK: version')), \
+ 'unexpected OK description "{}"'.format(opt.result)
return
self.result = self.opts[0].result
return
self.result = self.opts[0].result
@@
-282,8
+283,8
@@
class AND(ComplexOptCheck):
else:
# VersionCheck provides enough info
self.result = opt.result
else:
# VersionCheck provides enough info
self.result = opt.result
- if not opt.result.startswith('FAIL: version'):
-
sys.exit('[!] ERROR: unexpected FAIL description "{}"'.format(opt.result)
)
+ assert(opt.result.startswith('FAIL: version')), \
+
'unexpected FAIL description "{}"'.format(opt.result
)
return
return