forked from qt-creator/qt-creator
Change-Id: Ic3cb8571c79ab2880975a439d893ba794c153d7e Reviewed-by: Christian Stenger <christian.stenger@digia.com>
55 lines
2.1 KiB
Python
55 lines
2.1 KiB
Python
source("../../shared/qtcreator.py")
|
|
import re
|
|
|
|
SpeedCrunchPath = ""
|
|
|
|
def buildConfigFromFancyToolButton(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
|
|
startApplication("qtcreator" + SettingsPath)
|
|
openQmakeProject(SpeedCrunchPath)
|
|
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
|
|
|
|
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
|
|
|
|
availableConfigs = iterateBuildConfigs(1, 0, "Release")
|
|
if not availableConfigs:
|
|
test.fatal("Haven't found a suitable Qt version (need Release build) - leaving without building.")
|
|
for config in availableConfigs:
|
|
selectBuildConfig(1, 0, config)
|
|
buildConfig = buildConfigFromFancyToolButton(fancyToolButton)
|
|
if buildConfig != config:
|
|
test.fatal("Build configuration %s is selected instead of %s" % (buildConfig, config))
|
|
continue
|
|
test.log("Testing build configuration: " + config)
|
|
invokeMenuItem("Build", "Run qmake")
|
|
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)")
|
|
invokeMenuItem("Build", "Rebuild All")
|
|
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)", 300000)
|
|
checkCompile()
|
|
checkLastBuild()
|
|
|
|
# Add a new run configuration
|
|
|
|
invokeMenuItem("File", "Exit")
|
|
waitForCleanShutdown()
|
|
|
|
def init():
|
|
global SpeedCrunchPath
|
|
SpeedCrunchPath = os.path.join(srcPath, "creator-test-data", "speedcrunch", "src", "speedcrunch.pro")
|
|
cleanup()
|
|
|
|
def cleanup():
|
|
# Make sure the .user files are gone
|
|
cleanUpUserFiles(SpeedCrunchPath)
|
|
for dir in glob.glob(os.path.join(srcPath, "creator-test-data", "speedcrunch", "speedcrunch-build-*")):
|
|
deleteDirIfExists(dir)
|