SquishTests: Move definition of regexVerify() to where it's used

Change-Id: I1f06a36c62acbd6662737bdd6657981f3cf04c36
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Löhning
2023-12-12 10:31:41 +01:00
parent e743da1cbf
commit 4dd44e01c2
2 changed files with 14 additions and 13 deletions

View File

@@ -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\.")

View File

@@ -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