From 376be188538728f7cbd32aad38ed324dbe18e3b1 Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Fri, 9 Jun 2023 20:14:44 -0700 Subject: [PATCH] silence log by default just in fmv/fcvt and utf-8 tests this is overridable by setting SILENCELOG to any value, which is then used --- src/openpower/decoder/isa/test_caller_fmv_fcvt.py | 13 ++++++++++++- .../isa/test_caller_svp64_utf_8_validation.py | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/openpower/decoder/isa/test_caller_fmv_fcvt.py b/src/openpower/decoder/isa/test_caller_fmv_fcvt.py index 8bb90346..3e9233f3 100644 --- a/src/openpower/decoder/isa/test_caller_fmv_fcvt.py +++ b/src/openpower/decoder/isa/test_caller_fmv_fcvt.py @@ -3,7 +3,7 @@ import unittest from functools import lru_cache - +import os from openpower.test.fmv_fcvt.fmv_fcvt import (FMvFCvtCases, SVP64FMvFCvtCases) from openpower.test.runner import TestRunnerBase @@ -26,6 +26,7 @@ class TestFMvFCvtBase(TestRunnerBase): def __init__(self, test): assert test == 'test', f"test={test!r}" + self.__old_silence_log = os.environ.get("SILENCELOG") cases = make_cases() assert self.SPLIT_INDEX != -1, "must be overridden" # split cases evenly over tests @@ -42,6 +43,16 @@ class TestFMvFCvtBase(TestRunnerBase): # can't do raise SkipTest if `start == end`, it makes unittest break super().__init__(cases[start:end], fp=True) + def setUp(self): + super().setUp() + if self.__old_silence_log is None: + os.environ["SILENCELOG"] = "!*,default" + + def tearDown(self): + super().tearDown() + if self.__old_silence_log is None: + del os.environ["SILENCELOG"] + @classmethod def make_split_classes(cls): for i in range(cls.SPLIT_COUNT): diff --git a/src/openpower/decoder/isa/test_caller_svp64_utf_8_validation.py b/src/openpower/decoder/isa/test_caller_svp64_utf_8_validation.py index 83dc5ea4..b3b41a61 100644 --- a/src/openpower/decoder/isa/test_caller_svp64_utf_8_validation.py +++ b/src/openpower/decoder/isa/test_caller_svp64_utf_8_validation.py @@ -3,7 +3,7 @@ import unittest from functools import lru_cache - +import os from openpower.test.algorithms.svp64_utf_8_validation import \ SVP64UTF8ValidationTestCase from openpower.test.runner import TestRunnerBase @@ -26,6 +26,7 @@ class TestSVP64UTF8ValidationBase(TestRunnerBase): def __init__(self, test): assert test == 'test', f"test={test!r}" + self.__old_silence_log = os.environ.get("SILENCELOG") cases = make_cases() assert self.SPLIT_INDEX != -1, "must be overridden" # split cases evenly over tests @@ -42,6 +43,16 @@ class TestSVP64UTF8ValidationBase(TestRunnerBase): # can't do raise SkipTest if `start == end`, it makes unittest break super().__init__(cases[start:end]) + def setUp(self): + super().setUp() + if self.__old_silence_log is None: + os.environ["SILENCELOG"] = "!*,default" + + def tearDown(self): + super().tearDown() + if self.__old_silence_log is None: + del os.environ["SILENCELOG"] + @classmethod def make_split_classes(cls): for i in range(cls.SPLIT_COUNT): -- 2.30.2