test_engine: improve the output
authorAlexander Popov <alex.popov@linux.com>
Sun, 17 Sep 2023 16:42:47 +0000 (19:42 +0300)
committerAlexander Popov <alex.popov@linux.com>
Sun, 17 Sep 2023 16:42:47 +0000 (19:42 +0300)
kconfig_hardened_check/test_engine.py

index 8927cddad80461388361efb91cd0da0864ed7f13..8dcc5879e94d55a4e392f7368e16fd10ee820a00 100644 (file)
@@ -15,6 +15,7 @@ import io
 import sys
 from collections import OrderedDict
 import json
+import inspect
 from .engine import KconfigCheck, CmdlineCheck, SysctlCheck, VersionCheck, OR, AND, populate_with_data, perform_checks, override_expected_value
 
 
@@ -68,14 +69,14 @@ class TestEngine(unittest.TestCase):
         perform_checks(checklist)
 
         # print the table with the results
-        print('TABLE:')
+        print(f'\n{inspect.stack()[1].function}():')
+        print('=' * 121)
         for opt in checklist:
             opt.table_print('verbose', True) # verbose mode, with_results
             print()
             print('=' * 121)
 
         # print the results in JSON
-        print('JSON:')
         result = []
         for opt in checklist:
             result.append(opt.json_dump(True)) # with_results