From ae8d9af6f43a909b2a7006e4268d2faca5efa8c1 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 18 Jun 2021 12:57:18 +0200 Subject: [PATCH] Squish: Fix expectations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The output on finishing debugging had changed. Change-Id: I8193718594c0aceef13867d6acd1c8c0aaba6353 Reviewed-by: Robert Löhning --- tests/system/suite_debugger/tst_debug_empty_main/test.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/system/suite_debugger/tst_debug_empty_main/test.py b/tests/system/suite_debugger/tst_debug_empty_main/test.py index 5a639d5dacf..e9ff73c6d00 100644 --- a/tests/system/suite_debugger/tst_debug_empty_main/test.py +++ b/tests/system/suite_debugger/tst_debug_empty_main/test.py @@ -81,14 +81,19 @@ def main(): invokeMenuItem("File", "Exit") def __handleAppOutputWaitForDebuggerFinish__(): + def __lastLine__(editor): + lines = str(editor.plainText).strip().splitlines() + return lines[-1] if len(lines) else "" + ensureChecked(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton") appOutput = waitForObject("{type='Core::OutputWindow' visible='1' " "windowTitle='Application Output Window'}") - if not test.verify(waitFor("str(appOutput.plainText).rstrip().endswith('Debugging has finished')", 20000), + regex = re.compile(r".*Debugging of .* has finished( with exit code -?[0-9]+)?\.$") + if not test.verify(waitFor("regex.match(__lastLine__(appOutput))", 20000), "Verifying whether debugging has finished."): test.log("Aborting debugging to let test continue.") invokeMenuItem("Debug", "Abort Debugging") - waitFor("str(appOutput.plainText).endswith('Debugging has finished')", 5000) + waitFor("regex.match(__lastLine(appOutput))", 5000) def performDebugging(projectName): for kit, config in iterateBuildConfigs("Debug"):