Commit d229705d authored by Robert Loehning's avatar Robert Loehning Committed by Christian Stenger
Browse files

Squish: Checking if the right build configuration is set



Change-Id: Ib889d1d8269a8c58edc12b688360b94a0b4bdedf
Reviewed-by: default avatarRobert Löhning <robert.loehning@nokia.com>
parent bcf5da48
......@@ -87,7 +87,7 @@ def checkCompile():
output = waitForObject("{type='Core::OutputWindow' unnamed='1' visible='1' windowTitle='Compile Output'"
" window=':Qt Creator_Core::Internal::MainWindow'}", 20000)
waitFor("len(str(output.plainText))>0",5000)
success = str(output.plainText).lower().find("error")==-1
success = str(output.plainText).endswith("exited normally.")
if success:
test.log("Compile Output:\n%s" % output.plainText)
else:
......
......@@ -26,7 +26,7 @@ def openQmakeProject(projectPath):
clickButton(findObject("{text='Open' type='QPushButton'}"))
waitForObject("{type='Qt4ProjectManager::Internal::ProjectLoadWizard' visible='1' windowTitle='Project Setup'}")
selectFromCombo(":scrollArea.Create Build Configurations:_QComboBox", "For Each Qt Version One Debug And One Release")
clickButton(findObject("{text~='(Finish|Done)' type='QPushButton'}"))
clickButton(waitForObject("{text~='(Finish|Done)' type='QPushButton'}"))
def openCmakeProject(projectPath):
invokeMenuItem("File", "Open File or Project...")
......
......@@ -3,6 +3,14 @@ import re;
SpeedCrunchPath = ""
def buildConfigFromFancyToolButtton(fancyToolButton):
beginOfBuildConfig = "<b>Build:</b> "
endOfBuildConfig = "<br/><b>Deploy:</b>"
toolTipText = str(fancyToolButton.toolTip)
beginIndex = toolTipText.find(beginOfBuildConfig) + len(beginOfBuildConfig)
endIndex = toolTipText.find(endOfBuildConfig)
return toolTipText[beginIndex:endIndex]
def main():
if not neededFilePresent(SpeedCrunchPath):
return
......@@ -16,7 +24,8 @@ def main():
value = testData.field(record, "value")
test.compare(waitForObject(node).text, value)
clickButton(waitForObject(":*Qt Creator_Core::Internal::FancyToolButton"))
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
clickButton(fancyToolButton)
listWidget = waitForObject("{occurrence='2' type='ProjectExplorer::Internal::GenericListWidget' unnamed='1' visible='0' "
"window=':QtCreator.MenuBar_ProjectExplorer::Internal::MiniProjectTargetSelector'}")
sendEvent("QMouseEvent", waitForObject(":QtCreator.MenuBar_ProjectExplorer::Internal::MiniProjectTargetSelector"), QEvent.MouseButtonPress, -5, 5, Qt.LeftButton, 0)
......@@ -25,13 +34,18 @@ def main():
for row in range(listWidget.count):
currentItem = listWidget.item(row)
if prog.match(str(currentItem.text())):
clickButton(waitForObject(":*Qt Creator_Core::Internal::FancyToolButton"))
clickButton(fancyToolButton)
itemText = currentItem.text()
test.log("Testing build configuration: "+str(itemText))
if listWidget.currentRow != row:
listWidget.setItemSelected(currentItem, True)
rect = listWidget.visualItemRect(currentItem)
mouseClick(listWidget, rect.x+5, rect.y+5, 0, Qt.LeftButton)
sendEvent("QMouseEvent", waitForObject(":QtCreator.MenuBar_ProjectExplorer::Internal::MiniProjectTargetSelector"), QEvent.MouseButtonPress, -45, 64, Qt.LeftButton, 0)
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
buildConfig = buildConfigFromFancyToolButtton(fancyToolButton)
if buildConfig != currentItem.text():
test.fatal("Build configuration %s is selected instead of %s" % (buildConfig, currentItem.text()))
continue
invokeMenuItem("Build", "Run qmake")
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)")
invokeMenuItem("Build", "Rebuild All")
......
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