diff options
author | Jeremy Johnson <jeremy.johnson@arm.com> | 2023-09-14 17:02:09 +0100 |
---|---|---|
committer | Jeremy Johnson <jeremy.johnson@arm.com> | 2023-10-02 12:04:44 +0100 |
commit | e2b5e87804e158cb3e5d06a131c317b3890b87b3 (patch) | |
tree | fd8b5a4d56dfcea4be4e6ced73f2d4d5b2e1d92d /verif/checker/color_print.py | |
parent | bb0935f868a5ab09403cf3628848655b06ac1dec (diff) | |
download | reference_model-e2b5e87804e158cb3e5d06a131c317b3890b87b3.tar.gz |
Support for compliance checking testing
Updated to conformance generator to not generate tests with results for
compliance tests.
Updated test runner to run compliance mode version (precise & abs mode)
of reference model to create test results to use against SUT results.
Updated reference model to enable abs_mode on correct desc.json flags.
Updated test checker to support compliance checking using verifier lib.
Seperated color printing from test checker.
Change-Id: I7e2fbfc6883916caa5d94d4ece122c48bf45f530
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com>
Diffstat (limited to 'verif/checker/color_print.py')
-rw-r--r-- | verif/checker/color_print.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/verif/checker/color_print.py b/verif/checker/color_print.py new file mode 100644 index 0000000..1563b92 --- /dev/null +++ b/verif/checker/color_print.py @@ -0,0 +1,33 @@ +"""Color printing module.""" +# Copyright (c) 2020-2023, ARM Limited. +# SPDX-License-Identifier: Apache-2.0 +from enum import Enum +from enum import unique + +color_printing = True + + +@unique +class LogColors(Enum): + """Shell escape sequence colors for logging.""" + + NONE = "\u001b[0m" + GREEN = "\u001b[32;1m" + RED = "\u001b[31;1m" + YELLOW = "\u001b[33;1m" + BOLD_WHITE = "\u001b[1m" + + +def set_print_in_color(enabled): + """Set color printing to enabled or disabled.""" + global color_printing + color_printing = enabled + + +def print_color(color, msg): + """Print color status messages if enabled.""" + global color_printing + if not color_printing: + print(msg) + else: + print("{}{}{}".format(color.value, msg, LogColors.NONE.value)) |