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:
374aee3
)
Adjust test scripts to scrub ANSI colors from output
86/head
author
Frak
<frak.alnuaimy@technicolor.com>
Tue, 12 Sep 2023 15:47:28 +0000
(11:47 -0400)
committer
Frak
<frak.alnuaimy@technicolor.com>
Tue, 12 Sep 2023 15:47:28 +0000
(11:47 -0400)
kconfig_hardened_check/test_engine.py
patch
|
blob
|
history
diff --git
a/kconfig_hardened_check/test_engine.py
b/kconfig_hardened_check/test_engine.py
index dce10390aa1502607fdd63ab90019cb1447ef6db..c9177059ab4794413116afe5a94694ef2b2a19cc 100644
(file)
--- a/
kconfig_hardened_check/test_engine.py
+++ b/
kconfig_hardened_check/test_engine.py
@@
-16,6
+16,7
@@
import sys
from collections import OrderedDict
import json
from .engine import KconfigCheck, CmdlineCheck, SysctlCheck, VersionCheck, OR, AND, populate_with_data, perform_checks, override_expected_value
from collections import OrderedDict
import json
from .engine import KconfigCheck, CmdlineCheck, SysctlCheck, VersionCheck, OR, AND, populate_with_data, perform_checks, override_expected_value
+import re
class TestEngine(unittest.TestCase):
class TestEngine(unittest.TestCase):
@@
-387,8
+388,9
@@
class TestEngine(unittest.TestCase):
stdout_result = []
self.get_engine_result(config_checklist, stdout_result, 'stdout')
stdout_result = []
self.get_engine_result(config_checklist, stdout_result, 'stdout')
+ stdout_result_clean = [re.sub(r'\x1b(\[.*?[@-~]|\].*?(\x07|\x1b\\))', '', s) for s in stdout_result]
self.assertEqual(
self.assertEqual(
- stdout_result,
+ stdout_result
_clean
,
[
"\
CONFIG_NAME_1 |kconfig| expected_1 |decision_1| reason_1 | FAIL: is not found\
[
"\
CONFIG_NAME_1 |kconfig| expected_1 |decision_1| reason_1 | FAIL: is not found\
@@
-398,8
+400,9
@@
name_4 |cmdline| expected_4 |decision_4| re
stdout_result = []
self.get_engine_result(config_checklist, stdout_result, 'stdout_verbose')
stdout_result = []
self.get_engine_result(config_checklist, stdout_result, 'stdout_verbose')
+ stdout_result_clean = [re.sub(r'\x1b(\[.*?[@-~]|\].*?(\x07|\x1b\\))', '', s) for s in stdout_result]
self.assertEqual(
self.assertEqual(
- stdout_result,
+ stdout_result
_clean
,
[
"\
<<< OR >>> | FAIL: is not found\n\
[
"\
<<< OR >>> | FAIL: is not found\n\