From 6840c5e7ea74360f877e6c1c631200b67135ed06 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Wed, 19 Oct 2022 12:48:25 -0700 Subject: [PATCH] tests: Fix verifier '_iterable_regex' func for None regex In the case where no regex was specified (i,e., `regex == None`), the `_iterable_regex` function returned `None`. For the testlib to work this function must return an iterable. Without this patch it is not possible to compare two files without a specifying a regex. Change-Id: Ibc8a2f783c3b786dbdca6a4284850b594024f2f9 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64851 Maintainer: Jason Lowe-Power Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- tests/gem5/verifier.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/gem5/verifier.py b/tests/gem5/verifier.py index ff90b6d99a..0df9a10841 100644 --- a/tests/gem5/verifier.py +++ b/tests/gem5/verifier.py @@ -276,6 +276,8 @@ _re_type = type(re.compile("")) def _iterable_regex(regex): + if not regex: + return () # If no regex we return an empty tuple. if isinstance(regex, _re_type) or isinstance(regex, str): regex = (regex,) return regex