2011-08-26 12:39:04 +02:00
|
|
|
source("../../shared/qtcreator.py")
|
2012-03-26 14:04:31 +02:00
|
|
|
import re
|
2011-08-25 10:05:28 +02:00
|
|
|
|
|
|
|
|
SpeedCrunchPath = ""
|
2011-08-31 13:51:32 +02:00
|
|
|
|
2012-01-17 15:09:50 +01:00
|
|
|
def buildConfigFromFancyToolButton(fancyToolButton):
|
2011-12-08 18:45:31 +01:00
|
|
|
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]
|
|
|
|
|
|
2011-08-25 10:05:28 +02:00
|
|
|
def main():
|
2011-09-27 11:04:12 +02:00
|
|
|
if not neededFilePresent(SpeedCrunchPath):
|
|
|
|
|
return
|
2011-08-31 13:51:32 +02:00
|
|
|
startApplication("qtcreator" + SettingsPath)
|
|
|
|
|
openQmakeProject(SpeedCrunchPath)
|
2011-11-28 17:35:22 +01:00
|
|
|
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
|
2011-08-25 10:05:28 +02:00
|
|
|
|
2011-12-08 18:45:31 +01:00
|
|
|
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
|
2011-08-31 13:51:32 +02:00
|
|
|
|
2012-07-20 14:18:49 +02:00
|
|
|
availableConfigs = iterateBuildConfigs(1, 0, "Release")
|
2012-05-21 16:24:23 +02:00
|
|
|
if not availableConfigs:
|
|
|
|
|
test.fatal("Haven't found a suitable Qt version (need Release build) - leaving without building.")
|
|
|
|
|
for config in availableConfigs:
|
2012-01-17 13:47:47 +01:00
|
|
|
selectBuildConfig(1, 0, config)
|
2012-01-17 15:09:50 +01:00
|
|
|
buildConfig = buildConfigFromFancyToolButton(fancyToolButton)
|
2012-01-17 13:47:47 +01:00
|
|
|
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()
|
2011-08-25 10:05:28 +02:00
|
|
|
|
|
|
|
|
# Add a new run configuration
|
|
|
|
|
|
|
|
|
|
invokeMenuItem("File", "Exit")
|
2011-09-27 11:39:01 +02:00
|
|
|
waitForCleanShutdown()
|
2011-08-25 10:05:28 +02:00
|
|
|
|
|
|
|
|
def init():
|
|
|
|
|
global SpeedCrunchPath
|
2012-10-17 21:11:57 +02:00
|
|
|
SpeedCrunchPath = os.path.join(srcPath, "creator-test-data", "speedcrunch", "src", "speedcrunch.pro")
|
2011-08-25 10:05:28 +02:00
|
|
|
cleanup()
|
|
|
|
|
|
|
|
|
|
def cleanup():
|
|
|
|
|
# Make sure the .user files are gone
|
2011-09-27 11:39:01 +02:00
|
|
|
cleanUpUserFiles(SpeedCrunchPath)
|
2012-10-17 21:11:57 +02:00
|
|
|
for dir in glob.glob(os.path.join(srcPath, "creator-test-data", "speedcrunch", "speedcrunch-build-*")):
|
|
|
|
|
deleteDirIfExists(dir)
|