2011-08-26 12:39:04 +02:00
|
|
|
source("../../shared/qtcreator.py")
|
2011-08-31 13:51:32 +02:00
|
|
|
import re;
|
2011-08-25 10:05:28 +02:00
|
|
|
|
|
|
|
|
SpeedCrunchPath = ""
|
2011-08-31 16:05:15 +02:00
|
|
|
buildSucceeded = 0
|
2011-08-25 10:05:28 +02:00
|
|
|
buildFinished = False
|
2011-09-09 10:14:09 +02:00
|
|
|
refreshFinishedCount = 0
|
|
|
|
|
|
|
|
|
|
def handleRefreshFinished(object, fileList):
|
|
|
|
|
global refreshFinishedCount
|
|
|
|
|
refreshFinishedCount += 1
|
2011-08-31 13:51:32 +02:00
|
|
|
|
2011-08-25 10:05:28 +02:00
|
|
|
def main():
|
2011-09-09 10:14:09 +02:00
|
|
|
global buildSucceeded, buildFinished, refreshFinishedCount
|
2011-08-25 10:05:28 +02:00
|
|
|
test.verify(os.path.exists(SpeedCrunchPath))
|
2011-08-31 13:51:32 +02:00
|
|
|
startApplication("qtcreator" + SettingsPath)
|
2011-09-09 11:38:13 +02:00
|
|
|
installLazySignalHandler("{type='CppTools::Internal::CppModelManager'}", "sourceFilesRefreshed(QStringList)", "handleRefreshFinished")
|
2011-08-31 13:51:32 +02:00
|
|
|
openQmakeProject(SpeedCrunchPath)
|
2011-09-09 11:38:13 +02:00
|
|
|
waitFor("refreshFinishedCount == 1", 300000)
|
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-09-09 10:14:09 +02:00
|
|
|
installLazySignalHandler("{type='CppTools::Internal::CppModelManager'}", "sourceFilesRefreshed(QStringList)", "handleRefreshFinished")
|
|
|
|
|
|
2011-08-31 13:51:32 +02:00
|
|
|
clickButton(waitForObject(":*Qt Creator_Core::Internal::FancyToolButton"))
|
|
|
|
|
buildCombo = waitForObject(":Build:_QComboBox")
|
|
|
|
|
sendEvent("QMouseEvent", waitForObject(":QtCreator.MenuBar_ProjectExplorer::Internal::MiniProjectTargetSelector"), QEvent.MouseButtonPress, -5, 5, Qt.LeftButton, 0)
|
|
|
|
|
|
|
|
|
|
prog = re.compile("Qt.*Release")
|
|
|
|
|
for row in range(buildCombo.count):
|
|
|
|
|
if prog.match(str(buildCombo.itemText(row))):
|
2011-09-09 10:14:09 +02:00
|
|
|
refreshFinishedCount = 0;
|
2011-08-31 13:51:32 +02:00
|
|
|
clickButton(waitForObject(":*Qt Creator_Core::Internal::FancyToolButton"))
|
|
|
|
|
itemText = buildCombo.itemText(row);
|
|
|
|
|
test.log("Testing build configuration: "+str(itemText))
|
|
|
|
|
if str(itemText) != str(buildCombo.currentText):
|
|
|
|
|
buildCombo.setCurrentIndex(row)
|
|
|
|
|
sendEvent("QMouseEvent", waitForObject(":QtCreator.MenuBar_ProjectExplorer::Internal::MiniProjectTargetSelector"), QEvent.MouseButtonPress, -45, 64, Qt.LeftButton, 0)
|
2011-09-09 10:14:09 +02:00
|
|
|
waitFor("refreshFinishedCount == 1", 300000)
|
2011-08-31 13:51:32 +02:00
|
|
|
buildSucceeded = 0
|
|
|
|
|
buildFinished = False
|
|
|
|
|
invokeMenuItem("Build", "Rebuild All")
|
2011-08-31 16:05:15 +02:00
|
|
|
waitForBuildFinished(300000)
|
2011-08-25 10:05:28 +02:00
|
|
|
|
|
|
|
|
# Add a new run configuration
|
|
|
|
|
|
|
|
|
|
invokeMenuItem("File", "Exit")
|
|
|
|
|
|
|
|
|
|
def init():
|
|
|
|
|
global SpeedCrunchPath
|
|
|
|
|
SpeedCrunchPath = SDKPath + "/creator-test-data/speedcrunch/src/speedcrunch.pro"
|
|
|
|
|
cleanup()
|
|
|
|
|
|
|
|
|
|
def cleanup():
|
|
|
|
|
# Make sure the .user files are gone
|
|
|
|
|
if os.access(SpeedCrunchPath + ".user", os.F_OK):
|
|
|
|
|
os.remove(SpeedCrunchPath + ".user")
|
|
|
|
|
|
|
|
|
|
BuildPath = glob.glob(SDKPath + "/creator-test-data/speedcrunch/speedcrunch-build-*")
|
2011-08-31 13:51:32 +02:00
|
|
|
BuildPath += glob.glob(SDKPath + "/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)
|