From: Alexander Popov Date: Sun, 2 Apr 2023 09:27:57 +0000 (+0300) Subject: test_engine: support the non-verbose output mode in get_engine_result() X-Git-Tag: v0.6.6~182 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=d58e674ecffe074f5210aa7300114f3fb97ed0d1;p=kconfig-hardened-check.git test_engine: support the non-verbose output mode in get_engine_result() --- diff --git a/kconfig_hardened_check/test_engine.py b/kconfig_hardened_check/test_engine.py index d04618d..0b3fca9 100644 --- a/kconfig_hardened_check/test_engine.py +++ b/kconfig_hardened_check/test_engine.py @@ -79,7 +79,7 @@ class TestEngine(unittest.TestCase): @staticmethod def get_engine_result(checklist, result, result_type): - assert(result_type in ('json', 'stdout')), \ + assert(result_type in ('json', 'stdout', 'stdout_verbose')), \ f'invalid result type "{result_type}"' if result_type == 'json': @@ -91,7 +91,10 @@ class TestEngine(unittest.TestCase): stdout_backup = sys.stdout sys.stdout = captured_output for opt in checklist: - opt.table_print('verbose', True) # verbose mode, with_results + if result_type == 'stdout_verbose': + opt.table_print('verbose', True) # verbose mode, with_results + else: + opt.table_print(None, True) # normal mode, with_results sys.stdout = stdout_backup result.append(captured_output.getvalue()) @@ -330,7 +333,7 @@ class TestEngine(unittest.TestCase): ) stdout_result = [] - self.get_engine_result(config_checklist, stdout_result, 'stdout') + self.get_engine_result(config_checklist, stdout_result, 'stdout_verbose') self.assertEqual( stdout_result, [