Commit c8984dc5 authored by Robert Loehning's avatar Robert Loehning Committed by Christian Stenger

Squish: Using progressBarWait() instead of waitForSignal()

Change-Id: Ia87569c080f3b54dd8f78b023408de76eb3c574c
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 3245b706
......@@ -163,8 +163,7 @@ def selectBuildConfig(targetCount, currentTarget, configName):
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(targetCount, currentTarget, ProjectSettings.BUILD)
if selectFromCombo(":scrollArea.Edit build configuration:_QComboBox", configName):
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}",
"sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
return getQtInformationForBuildSettings(targetCount, True, ViewConstants.EDIT)
# This will not trigger a rebuild. If needed, caller has to do this.
......
......@@ -175,7 +175,7 @@ def createProject_Qt_GUI(path, projectName, checks = True):
expectedFiles.extend(__sortFilenamesOSDependent__(["main.cpp", cpp_file, h_file, ui_file, pro_file]))
__createProjectHandleLastPage__(expectedFiles)
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 20000)
progressBarWait(20000)
__verifyFileCreation__(path, expectedFiles)
return checkedTargets
......@@ -199,7 +199,7 @@ def createProject_Qt_Console(path, projectName, checks = True):
expectedFiles.extend(__sortFilenamesOSDependent__([cpp_file, pro_file]))
__createProjectHandleLastPage__(expectedFiles)
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 10000)
progressBarWait(10000)
__verifyFileCreation__(path, expectedFiles)
return checkedTargets
......@@ -224,7 +224,7 @@ def createNewQtQuickApplication(workingDir, projectName = None, templateFile = N
clickButton(nextButton)
__createProjectHandleLastPage__()
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 10000)
progressBarWait(10000)
return checkedTargets, projectName
def createNewQtQuickUI(workingDir):
......
......@@ -609,9 +609,9 @@ def checkIfObjectExists(name, shouldExist = True, timeout = 3000, verboseOnFail
return result
# wait for progress bar(s) to appear and disappear
def progressBarWait():
def progressBarWait(timeout=60000):
checkIfObjectExists("{type='Core::Internal::ProgressBar' unnamed='1'}", True, 2000)
checkIfObjectExists("{type='Core::Internal::ProgressBar' unnamed='1'}", False, 60000)
checkIfObjectExists("{type='Core::Internal::ProgressBar' unnamed='1'}", False, timeout)
def readFile(filename):
f = open(filename, "r")
......
......@@ -19,7 +19,7 @@ def main():
openQmakeProject(examplePath)
installLazySignalHandler("{type='Core::FutureProgress' unnamed='1'}", "finished()", "__handleFutureProgress__")
# wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
# open .cpp file in editor
if not openDocument("propertyanimation.Sources.main\\.cpp"):
test.fatal("Could not open main.cpp")
......
......@@ -17,7 +17,7 @@ def main():
# open example project
openQmakeProject(examplePath)
# wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
# open .cpp file in editor
if not openDocument("propertyanimation.Sources.main\\.cpp"):
test.fatal("Could not open main.cpp")
......
......@@ -28,8 +28,7 @@ def main():
# select "Create Project" and try to create a new project.
# create Qt Quick application from "Welcome" page -> "Develop" tab
createNewQtQuickApplication(tempDir(), "SampleApp", fromWelcome = True)
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}",
"sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
" text~='SampleApp( \(.*\))?' type='QModelIndex'}"),
"Verifying: The project is opened in 'Edit' mode after configuring.")
......@@ -42,8 +41,7 @@ def main():
examplePath = os.path.join(prepareTemplate(sourceExample), "propertyanimation.pro")
# open example project from "Welcome" page -> "Develop" tab
openQmakeProject(examplePath, fromWelcome = True)
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}",
"sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
" text~='propertyanimation( \(.*\))?' type='QModelIndex'}"),
"Verifying: The project is opened in 'Edit' mode after configuring.")
......
......@@ -19,9 +19,8 @@ def main():
overrideInstallLazySignalHandler()
installLazySignalHandler(":Qt Creator_CppEditor::Internal::CPPEditorWidget", "textChanged()",
"__handleTextChanged__")
prepareForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
openQmakeProject(proFile)
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 20000)
progressBarWait(20000)
selectFromLocator("dummy.cpp")
## Waiting for a solution from Froglogic to make the below work.
......
......@@ -21,7 +21,7 @@ def main():
if platform.system() in ('Windows', 'Microsoft'):
suitableKits |= Targets.DESKTOP_474_MSVC2008
checkedTargets = openQmakeProject(SpeedCrunchPath, suitableKits)
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
......
......@@ -21,7 +21,7 @@ def main():
test.fatal("Could not open/create cmake project - leaving test")
invokeMenuItem("File", "Exit")
return
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
# Invoke a rebuild of the application
invokeMenuItem("Build", "Rebuild All")
......
......@@ -12,10 +12,10 @@ def main():
openQmakeProject(pathSpeedcrunch)
# Wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
openQmakeProject(pathCreator)
# Wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 300000)
progressBarWait(300000)
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}"
compareProjectTree(naviTreeView % "speedcrunch( \(\S+\))?", "projecttree_speedcrunch.tsv")
......
......@@ -7,7 +7,7 @@ def main():
# using a temporary directory won't mess up a potentially existing
createNewQmlExtension(tempDir())
# wait for parsing to complete
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
progressBarWait(30000)
test.log("Building project")
invokeMenuItem("Build","Build All")
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)")
......
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