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 <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
diff --git a/tests/gem5/verifier.py b/tests/gem5/verifier.py
index ff90b6d..0df9a10 100644
--- a/tests/gem5/verifier.py
+++ b/tests/gem5/verifier.py
@@ -276,6 +276,8 @@
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