2011-08-26 12:39:04 +02:00
|
|
|
source("../../shared/qtcreator.py")
|
2011-08-25 10:05:28 +02:00
|
|
|
|
|
|
|
|
SpeedCrunchPath = ""
|
2011-08-31 13:51:32 +02:00
|
|
|
|
2011-12-08 18:45:31 +01:00
|
|
|
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]
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
# Test that some of the expected items are in the navigation tree
|
|
|
|
|
for row, record in enumerate(testData.dataset("speedcrunch_tree.tsv")):
|
|
|
|
|
node = testData.field(record, "node")
|
|
|
|
|
value = testData.field(record, "value")
|
|
|
|
|
test.compare(waitForObject(node).text, value)
|
|
|
|
|
|
2011-12-08 18:45:31 +01:00
|
|
|
fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
|
2011-08-31 13:51:32 +02:00
|
|
|
|
2012-01-17 13:47:47 +01:00
|
|
|
for config in iterateBuildConfigs(1, 0, "(Desktop )?Qt.*Release"):
|
|
|
|
|
selectBuildConfig(1, 0, config)
|
|
|
|
|
buildConfig = buildConfigFromFancyToolButtton(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()
|
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
|
2011-09-23 20:40:57 +02:00
|
|
|
SpeedCrunchPath = 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)
|
2011-08-25 10:05:28 +02:00
|
|
|
|
2011-09-23 20:40:57 +02:00
|
|
|
BuildPath = glob.glob(srcPath + "/creator-test-data/speedcrunch/speedcrunch-build-*")
|
|
|
|
|
BuildPath += glob.glob(srcPath + "/creator-test-data/speedcrunch/qtcreator-build-*")
|
2011-08-25 10:05:28 +02:00
|
|
|
|
2011-08-31 13:51:32 +02:00
|
|
|
if BuildPath:
|
|
|
|
|
for dir in BuildPath:
|
|
|
|
|
if os.access(dir, os.F_OK):
|
|
|
|
|
shutil.rmtree(dir)
|