aboutsummaryrefslogtreecommitdiff
path: root/verif/checker/tosa_result_checker.py
diff options
context:
space:
mode:
authorJeremy Johnson <jeremy.johnson@arm.com>2022-02-23 12:15:03 +0000
committerJeremy Johnson <jeremy.johnson@arm.com>2022-03-02 16:45:28 +0000
commit015c3550301fdc6d37606995322e144df0940ba2 (patch)
treef51448044ea8262f36aa964ce4b769406bb2cb7e /verif/checker/tosa_result_checker.py
parentc0fe04d4105884b61b5eeca4c0a932846a77b6e2 (diff)
downloadreference_model-015c3550301fdc6d37606995322e144df0940ba2.tar.gz
Add framework unit test generation scripts
And fixes in tosa_verif_run_tests: * support for no-color printing * stop double printing of error messages on verbose * differentiate result code pass from results check Change-Id: I26e957013a8d18f7d3d3691067dfb778008a1eea Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com>
Diffstat (limited to 'verif/checker/tosa_result_checker.py')
-rw-r--r--verif/checker/tosa_result_checker.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/verif/checker/tosa_result_checker.py b/verif/checker/tosa_result_checker.py
index 3a15de9..66864c2 100644
--- a/verif/checker/tosa_result_checker.py
+++ b/verif/checker/tosa_result_checker.py
@@ -11,7 +11,7 @@ from pathlib import Path
import numpy as np
##################################
-no_color_printing = False
+color_printing = True
@unique
@@ -25,9 +25,16 @@ class LogColors(Enum):
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."""
- if no_color_printing:
+ global color_printing
+ if not color_printing:
print(msg)
else:
print("{}{}{}".format(color.value, msg, LogColors.NONE.value))