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 13:51:32 +02:00
|
|
|
|
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-09-21 13:55:23 +02:00
|
|
|
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 30000)
|
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-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)
|
|
|
|
|
|
2011-11-01 10:38:52 +01:00
|
|
|
prog = re.compile("(Desktop )?Qt.*Release")
|
2011-08-31 13:51:32 +02:00
|
|
|
for row in range(buildCombo.count):
|
|
|
|
|
if prog.match(str(buildCombo.itemText(row))):
|
|
|
|
|
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-21 13:55:23 +02:00
|
|
|
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 30000)
|
|
|
|
|
invokeMenuItem("Build", "Run qmake")
|
|
|
|
|
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)", 300000)
|
2011-08-31 13:51:32 +02:00
|
|
|
invokeMenuItem("Build", "Rebuild All")
|
2011-09-21 13:55:23 +02:00
|
|
|
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)
|