Commit 7edb9d25 by Alexander Popov

Improve the OR result calculation

1. don't duplicate opts[0].name in the successful output;
2. fix the bug with printing None state, just reuse the OptCheck.result.
parent cc52eb9b
...@@ -83,12 +83,15 @@ class OR: ...@@ -83,12 +83,15 @@ class OR:
return self.opts[0].reason return self.opts[0].reason
def check(self): def check(self):
for opt in self.opts: for i, opt in enumerate(self.opts):
result, msg = opt.check() result, msg = opt.check()
if result: if result:
self.result = 'OK (CONFIG_{} {})'.format(opt.name, opt.state) if i == 0:
return result, self.result self.result = opt.result
self.result = 'FAIL: "{}"'.format(self.opts[0].state) else:
self.result = 'CONFIG_{}: {} ("{}")'.format(opt.name, opt.result, opt.expected)
return True, self.result
self.result = self.opts[0].result
return False, self.result return False, self.result
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment