Commit 756fb879 authored by Bill King's avatar Bill King
Browse files

Initial commit of squish tests for creator.

Change-Id: Ic499b3c36d37f9789276f60a41642ffc7ee816d1
Reviewed-on: http://codereview.qt.nokia.com/3047

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarBill King <bill.king@nokia.com>
parent 3dcf1681
:*Qt Creator.findEdit_Utils::FilterLineEdit {name='findEdit' type='Utils::FilterLineEdit' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator_Utils::FilterLineEdit {type='Utils::FilterLineEdit' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator_Utils::IconButton {occurrence='4' type='Utils::IconButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:CMake Wizard.Finish_QPushButton {text='Finish' type='QPushButton' unnamed='1' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}
:CMake Wizard.Next_QPushButton {name='__qt__passive_wizardbutton1' text='Next' type='QPushButton' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}
:CMake Wizard.Run CMake_QPushButton {text='Run CMake' type='QPushButton' unnamed='1' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}
:CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard {type='CMakeProjectManager::Internal::CMakeOpenProjectWizard' unnamed='1' visible='1' windowTitle='CMake Wizard'}
:Qt Creator_Core::Internal::MainWindow {type='Core::Internal::MainWindow' unnamed='1' visible='1' windowTitle?='*Qt Creator'}
:Qt Creator_CppEditor::Internal::CPPEditorWidget {type='CppEditor::Internal::CPPEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Utils::IconButton {occurrence='2' type='Utils::IconButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Utils::NavigationTreeView {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:projects.projects.pro_QModelIndex {column='0' container=':projects_QModelIndex' text='projects.pro' type='QModelIndex'}
:projects_QModelIndex {column='0' container=':Qt Creator_Utils::NavigationTreeView' text='projects' type='QModelIndex'}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorQtVersions>
<!-- Written by Qt Creator 2.2.81, 2011-06-06T16:08:30. -->
<qtcreator>
<data>
<variable>QtVersion.0</variable>
<valuemap type="QVariantMap">
<value type="int" key="Id">4</value>
<value type="QString" key="Name">Qt for Fremantle PR1.3 Devices (Qt SDK)</value>
<value type="QString" key="QMakePath">~/QtSDK/Maemo/4.6.2/targets/fremantle-pr13/bin/qmake</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Maemo</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
</data>
<data>
<variable>QtVersion.1</variable>
<valuemap type="QVariantMap">
<value type="int" key="Id">5</value>
<value type="QString" key="Name">Desktop Qt 4.7.3 for GCC (Qt SDK)</value>
<value type="QString" key="QMakePath">~/QtSDK/Desktop/Qt/473/gcc/bin/qmake</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Desktop</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
</data>
<data>
<variable>QtVersion.2</variable>
<valuemap type="QVariantMap">
<value type="int" key="Id">6</value>
<value type="QString" key="Name">Simulator Qt for GCC (Qt SDK)</value>
<value type="QString" key="QMakePath">~/QtSDK/Simulator/Qt/gcc/bin/qmake</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Simulator</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
</data>
<data>
<variable>QtVersion.3</variable>
<valuemap type="QVariantMap">
<value type="int" key="Id">8</value>
<value type="QString" key="Name">4.7.0</value>
<value type="QString" key="QMakePath">/usr/bin/qmake</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Desktop</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
</data>
<data>
<variable>QtVersion.Count</variable>
<value type="int">4</value>
</data>
<data>
<variable>Version</variable>
<value type="int">1</value>
</data>
</qtcreator>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorToolChains>
<!-- Written by Qt Creator 2.2.81, 2011-06-06T16:08:33. -->
<qtcreator>
<data>
<variable>ToolChain.Count</variable>
<value type="int">0</value>
</data>
<data>
<variable>Version</variable>
<value type="int">1</value>
</data>
</qtcreator>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorQtVersions>
<!-- Written by Qt Creator 2.2.81, 2011-05-30T15:44:21. -->
<qtcreator>
<data>
<variable>QtVersion.0</variable>
<valuemap type="QVariantMap">
<value type="int" key="Id">2</value>
<value type="QString" key="Name">Qt 4.7.3 for Desktop - MinGW 4.4 (Qt SDK)</value>
<value type="QString" key="QMakePath">c:/qtsdk/desktop/qt/4.7.3/mingw/bin/qmake.exe</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Desktop</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
</data>
<data>
<variable>QtVersion.1</variable>
<valuemap type="QVariantMap">
<value type="int" key="Id">3</value>
<value type="QString" key="Name">Simulator Qt for Visual Studio 2008 (Qt SDK)</value>
<value type="QString" key="QMakePath">c:/qtsdk/simulator/qt/msvc2008/bin/qmake.exe</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Simulator</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
</data>
<data>
<variable>QtVersion.2</variable>
<valuemap type="QVariantMap">
<value type="int" key="Id">4</value>
<value type="QString" key="Name">Qt 4.7.3 for Desktop - MSVC2005 (Qt SDK)</value>
<value type="QString" key="QMakePath">c:/qtsdk/desktop/qt/4.7.3/msvc2005/bin/qmake.exe</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Desktop</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
</data>
<data>
<variable>QtVersion.3</variable>
<valuemap type="QVariantMap">
<value type="int" key="Id">5</value>
<value type="QString" key="Name">Simulator Qt for Visual Studio 2005 (Qt SDK)</value>
<value type="QString" key="QMakePath">c:/qtsdk/simulator/qt/msvc2005/bin/qmake.exe</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Simulator</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
</data>
<data>
<variable>QtVersion.4</variable>
<valuemap type="QVariantMap">
<value type="int" key="Id">6</value>
<value type="QString" key="Name">Qt 4.7.3 for Desktop - MSVC2008 (Qt SDK)</value>
<value type="QString" key="QMakePath">c:/qtsdk/desktop/qt/4.7.3/msvc2008/bin/qmake.exe</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Desktop</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
</data>
<data>
<variable>QtVersion.5</variable>
<valuemap type="QVariantMap">
<value type="int" key="Id">7</value>
<value type="QString" key="Name">Qt for Fremantle PR1.3 Devices (Qt SDK)</value>
<value type="QString" key="QMakePath">c:/qtsdk/maemo/4.6.2/targets/fremantle-pr13/bin/qmake.exe</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Maemo</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
</data>
<data>
<variable>QtVersion.6</variable>
<valuemap type="QVariantMap">
<value type="int" key="Id">8</value>
<value type="QString" key="Name">Simulator Qt for MinGW 4.4 (Qt SDK)</value>
<value type="QString" key="QMakePath">c:/qtsdk/simulator/qt/mingw/bin/qmake.exe</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Simulator</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
</data>
<data>
<variable>QtVersion.7</variable>
<valuemap type="QVariantMap">
<value type="int" key="Id">9</value>
<value type="QString" key="Name">Qt 4.7.3 for Symbian^1 (Qt SDK)</value>
<value type="QString" key="QMakePath">c:/qtsdk/symbian/sdks/symbian1qt473/bin/qmake.exe</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Symbian</value>
<value type="QString" key="SBSv2Directory"></value>
<value type="QString" key="SystemRoot">C:/QtSDK/Symbian/SDKs/Symbian1Qt473/</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
</data>
<data>
<variable>QtVersion.8</variable>
<valuemap type="QVariantMap">
<value type="int" key="Id">10</value>
<value type="QString" key="Name">Qt 4.7.3 for Symbian^3 (Qt SDK)</value>
<value type="QString" key="QMakePath">c:/qtsdk/symbian/sdks/symbian3qt473/bin/qmake.exe</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Symbian</value>
<value type="QString" key="SBSv2Directory">C:/QtSDK/Symbian/tools/sbs/bin</value>
<value type="QString" key="SystemRoot">C:/QtSDK/Symbian/SDKs/Symbian3Qt473/</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
</data>
<data>
<variable>QtVersion.Count</variable>
<value type="int">9</value>
</data>
<data>
<variable>Version</variable>
<value type="int">1</value>
</data>
</qtcreator>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorToolChains>
<!-- Written by Qt Creator 2.2.81, 2011-05-30T15:56:04. -->
<qtcreator>
<data>
<variable>ToolChain.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.GccToolChain.Debugger">C:/QtSDK/pythongdb/python_2.7based/gdb-i686-pc-mingw32.exe</value>
<value type="QString" key="ProjectExplorer.GccToolChain.Path">C:/QtSDK/mingw/bin/g++.exe</value>
<value type="QString" key="ProjectExplorer.GccToolChain.TargetAbi">x86-windows-msys-pe-32bit</value>
<value type="QString" key="ProjectExplorer.ToolChain.DisplayName">MinGW from SDK</value>
<value type="QString" key="ProjectExplorer.ToolChain.Id">ProjectExplorer.ToolChain.Mingw:C:/QtSDK/mingw/bin/g++.exe.x86-windows-msys-pe-32bit.C:/QtSDK/pythongdb/python_2.7based/gdb-i686-pc-mingw32.exe</value>
</valuemap>
</data>
<data>
<variable>ToolChain.1</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.GccToolChain.Debugger">C:/QtSDK/pythongdb/python_2.7based/gdb-arm-none-symbianelf.exe</value>
<value type="QString" key="ProjectExplorer.GccToolChain.Path">C:/QtSDK/Symbian/tools/gcce4/bin/arm-none-symbianelf-g++.exe</value>
<value type="QString" key="ProjectExplorer.GccToolChain.TargetAbi">arm-symbian-device-elf-32bit</value>
<value type="QString" key="ProjectExplorer.ToolChain.DisplayName">GCCE from SDK</value>
<value type="QString" key="ProjectExplorer.ToolChain.Id">Qt4ProjectManager.ToolChain.GCCE:C:/QtSDK/Symbian/tools/gcce4/bin/arm-none-symbianelf-g++.exe.arm-symbian-device-elf-32bit.C:/QtSDK/pythongdb/python_2.7based/gdb-arm-none-symbianelf.exe</value>
</valuemap>
</data>
<data>
<variable>ToolChain.Count</variable>
<value type="int">2</value>
</data>
<data>
<variable>Version</variable>
<value type="int">1</value>
</data>
</qtcreator>
def invokeMenuItem(menu, item):
menuObject = waitForObjectItem("{type='QMenuBar' visible='true'}", menu)
activateItem(menuObject)
activateItem(waitForObjectItem(menuObject, item))
def openProject(projectPath):
invokeMenuItem("File", "Open File or Project...")
waitForObject("{name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'}")
type(findObject("{name='fileNameEdit' type='QLineEdit'}"), projectPath)
clickButton(findObject("{text='Open' type='QPushButton'}"))
waitForObject("{type='Qt4ProjectManager::Internal::ProjectLoadWizard' visible='1' windowTitle='Project Setup'}")
clickButton(findObject("{text='Finish' type='QPushButton'}"))
import platform;
import shutil;
import os;
import glob;
SDKPath = ''
SettingsPath = ''
testSettings.logScreenshotOnFail = True
source(findFile("scripts", "utils.py"))
source(findFile("scripts", "mainwin.py"))
if platform.system() in ('Windows', 'Microsoft'):
SDKPath = "C:/QtSDK/src"
cwd = os.getcwd() # current dir is directory holding qtcreator.py
cwd+="/../../settings/windows"
cwd = os.path.abspath(cwd)
SettingsPath = " -settingspath %s" % cwd
else:
SDKPath = os.path.expanduser("~/QtSDK/src")
cwd = os.getcwd() # current dir is directory holding qtcreator.py
cwd+="/../../settings/unix"
cwd = os.path.abspath(cwd)
SettingsPath = " -settingspath %s" % cwd
import tempfile, shutil, os
def tempDir():
return tempfile.mkdtemp()
def deleteDirIfExists(path):
shutil.rmtree(path, True)
def verifyChecked(objectName):
object = waitForObject(objectName, 20000)
test.compare(object.checked, True)
return object
def verifyEnabled(objectName):
object = waitForObject(objectName, 20000)
test.compare(object.enabled, True)
return object
def selectFromCombo(objectName, itemName):
object = verifyEnabled(objectName)
mouseClick(object, 198, 7, 0, Qt.LeftButton)
mouseClick(waitForObjectItem(object, itemName), 84, 5, 0, Qt.LeftButton)
def wordUnderCursor(window):
cursor = window.textCursor()
oldposition = cursor.position()
cursor.movePosition(QTextCursor.StartOfWord)
cursor.movePosition(QTextCursor.EndOfWord, QTextCursor.KeepAnchor)
returnValue = cursor.selectedText()
cursor.setPosition(oldposition)
return returnValue
def lineUnderCursor(window):
cursor = window.textCursor()
oldposition = cursor.position()
cursor.movePosition(QTextCursor.StartOfLine)
cursor.movePosition(QTextCursor.EndOfLine, QTextCursor.KeepAnchor)
returnValue = cursor.selectedText()
cursor.setPosition(oldposition)
return returnValue
def which(program):
def is_exe(fpath):
return os.path.exists(fpath) and os.access(fpath, os.X_OK)
fpath, fname = os.path.split(program)
if fpath:
if is_exe(program):
return program
if platform.system() in ('Windows', 'Microsoft'):
if is_exe(program + ".exe"):
return program + ".exe"
else:
for path in os.environ["PATH"].split(os.pathsep):
exe_file = os.path.join(path, program)
if is_exe(exe_file):
return exe_file
if platform.system() in ('Windows', 'Microsoft'):
if is_exe(exe_file + ".exe"):
return exe_file + ".exe"
return None
QT_PLATFORM_PLUGIN=nonesuch
"node" "value"
":projects.projects.pro_QModelIndex" "projects.pro"
":projects_QModelIndex" "projects"
AUT=qtcreator
CLASS=
CLASSPATH=
CWD=
ENVVARS=envvars
HOOK_SUB_PROCESSES=true
IMPLICITAUTSTART=0
LANGUAGE=Python
OBJECTMAP=../objects.map
TEST_CASES=tst_openqt_creator tst_build_speedcrunch tst_cmake_speedcrunch tst_basic_cpp_support
VERSION=2
WRAPPERS=Qt
source(findFile("scripts", "qtcreator.py"))
refreshFinishedCount = 0
def handleRefreshFinished(object, fileList):
global refreshFinishedCount
refreshFinishedCount += 1
def main():
startApplication("qtcreator" + SettingsPath)
installLazySignalHandler("{type='CppTools::Internal::CppModelManager'}", "sourceFilesRefreshed(QStringList)", "handleRefreshFinished")
test.verify(os.path.exists(SDKPath + "/creator/tests/manual/cplusplus-tools/cplusplus-tools.pro"))
openProject(SDKPath + "/creator/tests/manual/cplusplus-tools/cplusplus-tools.pro")
waitFor("refreshFinishedCount == 1", 20000)
test.compare(refreshFinishedCount, 1)
mouseClick(waitForObject(":*Qt Creator_Utils::FilterLineEdit", 20000), 110, 11, 0, Qt.LeftButton)
type(waitForObject(":*Qt Creator_Utils::FilterLineEdit"), "dummy.cpp")
# pause to wait for results to populate
snooze(1)
type(waitForObject(":*Qt Creator_Utils::FilterLineEdit"), "<Return>")
# editorManager = waitForObject("{type='Core::EditorManager'}", 2000)
# t2 = editorManager.currentEditor()
# t3 = t2.file()
# t4 = t3.fileName
# test.compare(editorManager.currentEditor().file().fileName, "base.cpp")
cppwindow = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
# - Move the cursor to the usage of a variable.
# - Press F2 or select from the menu: Tools / C++ / Follow Symbol under Cursor
# Creator will show you the declaration of the variable.
type(cppwindow, "<Ctrl+F>")
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), " xi")
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "<Return>")
type(cppwindow, "<F2>")
test.compare(lineUnderCursor(findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "extern int xi;")
# - Move the cursor to a function call.
# - Press F2 or select from the menu: Tools / C++ / Follow Symbol under Cursor
# Creator will show you the definition of the function.
type(cppwindow, "<Ctrl+F>")
clickButton(waitForObject(":*Qt Creator_Utils::IconButton"))
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "freefunc2")
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "<Return>")
type(cppwindow, "<F2>")
test.compare(lineUnderCursor(findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "int freefunc2(double)")
# - Move the cursor to a function declaration
# - Press Shift+F2 or select from menu: Tools / C++ / Switch Between Method Declaration/Definition
# Creator should show the definition of this function
# - Press Shift+F2 or select from menu: Tools / C++ / Switch Between Method Declaration/Definition again
# Creator should show the declaration of the function again.
mouseClick(waitForObject(":*Qt Creator_Utils::FilterLineEdit", 20000), 110, 11, 0, Qt.LeftButton)
clickButton(waitForObject(":Qt Creator_Utils::IconButton"))
type(waitForObject(":*Qt Creator_Utils::FilterLineEdit"), "dummy.cpp")
# pause to wait for results to populate
snooze(1)
type(waitForObject(":*Qt Creator_Utils::FilterLineEdit"), "<Return>")
# Reset cursor to the start of the document
cursor = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget").textCursor()
cursor.movePosition(QTextCursor.Start)
cppwindow.setTextCursor(cursor)
type(cppwindow, "<Ctrl+F>")
clickButton(waitForObject(":*Qt Creator_Utils::IconButton"))
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "Dummy::Dummy")
# Take us to the second instance
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "<Return>")
type(cppwindow, "<Shift+F2>")
test.compare(lineUnderCursor(findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), " Dummy(int a);")
type(cppwindow, "<Shift+F2>")
test.compare(lineUnderCursor(findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "Dummy::Dummy(int)")
invokeMenuItem("File", "Exit")
def init():
cleanup()
def cleanup():
# Make sure the .user files are gone
if os.access(SDKPath + "/creator/tests/manual/cplusplus-tools/cplusplus-tools.pro.user", os.F_OK):
os.remove(SDKPath + "/creator/tests/manual/cplusplus-tools/cplusplus-tools.pro.user")
BuildPath = glob.glob(SDKPath + "/qtcreator-build-*")
BuildPath += glob.glob(SDKPath + "/projects-build-*")
for dir in BuildPath:
if os.access(dir, os.F_OK):
shutil.rmtree(dir)
source(findFile("scripts", "qtcreator.py"))
SpeedCrunchPath = ""
buildFinished = False
buildSucceeded = False
def handleBuildFinished(object, success):
global buildFinished, buildSucceeded
buildFinished = True
buildSucceeded = success
def main():
startApplication("qtcreator" + SettingsPath)
test.verify(os.path.exists(SpeedCrunchPath))
openProject(SpeedCrunchPath)
# 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)
# Invoke a rebuild of the application
invokeMenuItem("Build", "Rebuild All")
# Wait for, and test if the build succeeded
installLazySignalHandler("{type='ProjectExplorer::BuildManager'}", "buildQueueFinished(bool)", "handleBuildFinished")
waitFor("buildFinished == True", 30000)
test.verify(buildSucceeded == 1)
# Now that this has finished, test adding a new build configuration
# 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-*")
for dir in BuildPath:
if os.access(dir, os.F_OK):
shutil.rmtree(dir)
source(findFile("scripts", "qtcreator.py"))
SpeedCrunchPath = ""
buildFinished = False
buildSucceeded = False
def handleBuildFinished(object, success):
global buildFinished, buildSucceeded
buildFinished = True
buildSucceeded = success
def main():
if(which("cmake") == None):
test.fatal("cmake not found")
return
startApplication("qtcreator" + SettingsPath)
invokeMenuItem("File", "Open File or Project...")
test.verify(os.path.exists(SpeedCrunchPath))
waitForObject("{name='QFileDialog' type='QFileDialog' visible='1' windowTitle='Open File'}", 20000)
type(findObject("{name='fileNameEdit' type='QLineEdit'}"), SpeedCrunchPath)
clickButton(findObject("{text='Open' type='QPushButton'}"))
clickButton(waitForObject(":CMake Wizard.Next_QPushButton", 20000))
clickButton(waitForObject(":CMake Wizard.Run CMake_QPushButton", 20000))
clickButton(waitForObject(":CMake Wizard.Finish_QPushButton", 60000))
waitFor("object.exists(':speedcrunch_QModelIndex')", 20000)
# 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(findObject(node).text, value)
# Invoke a rebuild of the application
installLazySignalHandler("{type='ProjectExplorer::BuildManager'}", "buildQueueFinished(bool)", "handleBuildFinished")
invokeMenuItem("Build", "Rebuild All")
# Wait for, and test if the build succeeded
waitFor("buildFinished == True", 300000)
test.verify(buildSucceeded == 1)
invokeMenuItem("File", "Exit")
def init():
global SpeedCrunchPath
SpeedCrunchPath = SDKPath + "/creator-test-data/speedcrunch/src/CMakeLists.txt"
cleanup()
def cleanup():
# Make sure the .user files are gone
if os.access(SpeedCrunchPath + ".user", os.F_OK):
os.remove(SpeedCrunchPath + ".user")
BuildPath = SDKPath + "/creator-test-data/speedcrunch/src/qtcreator-build"
if os.access(BuildPath, os.F_OK):
shutil.rmtree(BuildPath)
source(findFile("scripts", "qtcreator.py"))
refreshFinishedCount = 0
def handleRefreshFinished(object, fileList):
global refreshFinishedCount
refreshFinishedCount +=