From 4dd44e01c25b25c117c61dc3355528d3335a8269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Tue, 12 Dec 2023 10:31:41 +0100 Subject: [PATCH] SquishTests: Move definition of regexVerify() to where it's used Change-Id: I1f06a36c62acbd6662737bdd6657981f3cf04c36 Reviewed-by: Christian Stenger --- tests/system/shared/debugger.py | 14 ++++++++++++++ tests/system/shared/utils.py | 13 ------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/tests/system/shared/debugger.py b/tests/system/shared/debugger.py index d409d5b0668..bb6b4082b63 100644 --- a/tests/system/shared/debugger.py +++ b/tests/system/shared/debugger.py @@ -107,6 +107,20 @@ def removeOldBreakpoints(): # This can be the return value of setBreakpointsForCurrentProject() if you # passed the breakpoints into that function in the right order def doSimpleDebugging(currentKit, currentConfigName, expectedBPOrder=[], enableQml=True): + + # this function verifies if the text matches the given + # regex inside expectedTexts + # param text must be a single str + # param expectedTexts can be str/list/tuple + def regexVerify(text, expectedTexts): + if isString(expectedTexts): + expectedTexts = [expectedTexts] + for curr in expectedTexts: + pattern = re.compile(curr) + if pattern.match(text): + return True + return False + expectedLabelTexts = ['Stopped\.', 'Stopped at breakpoint \d+ in thread \d+\.'] if len(expectedBPOrder) == 0: expectedLabelTexts.append("Running\.") diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index f5e0f5845f5..d424bd72021 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -370,19 +370,6 @@ def enabledCheckBoxExists(text): except: return False -# this function verifies if the text matches the given -# regex inside expectedTexts -# param text must be a single str -# param expectedTexts can be str/list/tuple -def regexVerify(text, expectedTexts): - if isString(expectedTexts): - expectedTexts = [expectedTexts] - for curr in expectedTexts: - pattern = re.compile(curr) - if pattern.match(text): - return True - return False - # function that opens Options Dialog and parses the configured Qt versions # the function returns a list of the found Qt versions