Commit 5bcc7240 authored by Robert Loehning's avatar Robert Loehning
Browse files

Squish: Replace failing wait statements in tst_cli_output_console



Change-Id: I862812802722f66b6c100458b5aaea7c7165b248
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 2a4a41da
...@@ -31,23 +31,16 @@ source("../../shared/qtcreator.py") ...@@ -31,23 +31,16 @@ source("../../shared/qtcreator.py")
project = "untitled" project = "untitled"
def __handlerunControlFinished__(object, runControlP):
global runControlFinished
runControlFinished = True
def main(): def main():
if platform.system() == "Darwin" and JIRA.isBugStillOpen(6853, JIRA.Bug.CREATOR): if platform.system() == "Darwin" and JIRA.isBugStillOpen(6853, JIRA.Bug.CREATOR):
test.xverify(False, "This test is unstable on Mac, see QTCREATORBUG-6853.") test.xverify(False, "This test is unstable on Mac, see QTCREATORBUG-6853.")
return return
global runControlFinished
outputQDebug = "Output from qDebug()." outputQDebug = "Output from qDebug()."
outputStdOut = "Output from std::cout." outputStdOut = "Output from std::cout."
outputStdErr = "Output from std::cerr." outputStdErr = "Output from std::cerr."
startApplication("qtcreator" + SettingsPath) startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError(): if not startedWithoutPluginError():
return return
installLazySignalHandler("{type='ProjectExplorer::Internal::ProjectExplorerPlugin' unnamed='1'}",
"runControlFinished(ProjectExplorer::RunControl*)", "__handlerunControlFinished__")
checkedTargets = createProject_Qt_Console(tempDir(), project) checkedTargets = createProject_Qt_Console(tempDir(), project)
mainEditor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") mainEditor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
...@@ -73,16 +66,15 @@ def main(): ...@@ -73,16 +66,15 @@ def main():
test.log("Testing build configuration: " + config) test.log("Testing build configuration: " + config)
test.log("Running application") test.log("Running application")
progressBarWait(15000)
setRunInTerminal(len(checkedTargets), kit, False) setRunInTerminal(len(checkedTargets), kit, False)
runControlFinished = False
clickButton(waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")) clickButton(waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton"))
waitFor("runControlFinished==True", 20000) outputButton = waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton")
if not runControlFinished: waitFor("outputButton.checked", 20000) # Not ensureChecked(), avoid race condition
test.warning("Waiting for runControlFinished timed out") outputWindow = waitForObject(":Qt Creator_Core::OutputWindow")
ensureChecked(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton") waitFor("'exited with code' in str(outputWindow.plainText) or \
'The program has unexpectedly finished' in str(outputWindow.plainText)", 20000)
try: try:
appOutput = str(waitForObject("{type='Core::OutputWindow' unnamed='1' visible='1'}").plainText) appOutput = str(waitForObject(":Qt Creator_Core::OutputWindow").plainText)
verifyOutput(appOutput, outputStdOut, "std::cout", "Application Output") verifyOutput(appOutput, outputStdOut, "std::cout", "Application Output")
verifyOutput(appOutput, outputStdErr, "std::cerr", "Application Output") verifyOutput(appOutput, outputStdErr, "std::cerr", "Application Output")
verifyOutput(appOutput, outputQDebug, "qDebug()", "Application Output") verifyOutput(appOutput, outputQDebug, "qDebug()", "Application Output")
...@@ -93,13 +85,12 @@ def main(): ...@@ -93,13 +85,12 @@ def main():
test.log("Debugging application") test.log("Debugging application")
isMsvc = isMsvcConfig(len(checkedTargets), kit) isMsvc = isMsvcConfig(len(checkedTargets), kit)
runControlFinished = False
invokeMenuItem("Debug", "Start Debugging", "Start Debugging") invokeMenuItem("Debug", "Start Debugging", "Start Debugging")
JIRA.performWorkaroundForBug(6853, JIRA.Bug.CREATOR, config) JIRA.performWorkaroundForBug(6853, JIRA.Bug.CREATOR, config)
handleDebuggerWarnings(config, isMsvc) handleDebuggerWarnings(config, isMsvc)
waitFor("runControlFinished==True", 20000) ensureChecked(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton")
if not runControlFinished: outputWindow = waitForObject(":Qt Creator_Core::OutputWindow")
test.warning("Waiting for runControlFinished timed out") waitFor("'Debugging has finished' in str(outputWindow.plainText)", 20000)
try: try:
debuggerLog = takeDebuggerLog() debuggerLog = takeDebuggerLog()
if not isMsvc: if not isMsvc:
...@@ -118,7 +109,7 @@ def main(): ...@@ -118,7 +109,7 @@ def main():
switchViewTo(ViewConstants.EDIT) switchViewTo(ViewConstants.EDIT)
ensureChecked(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton") ensureChecked(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton")
try: try:
appOutput = str(waitForObject("{type='Core::OutputWindow' unnamed='1' visible='1'}").plainText) appOutput = str(waitForObject(":Qt Creator_Core::OutputWindow").plainText)
if not isMsvc: if not isMsvc:
verifyOutput(appOutput, outputStdOut, "std::cout", "Application Output") verifyOutput(appOutput, outputStdOut, "std::cout", "Application Output")
verifyOutput(appOutput, outputStdErr, "std::cerr", "Application Output") verifyOutput(appOutput, outputStdErr, "std::cerr", "Application Output")
...@@ -127,5 +118,6 @@ def main(): ...@@ -127,5 +118,6 @@ def main():
except: except:
test.fatal("Could not find Application Output Window", test.fatal("Could not find Application Output Window",
"Did the application run at all?") "Did the application run at all?")
progressBarWait(10000, False) # wait for "Build" progressbar to disappear
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment