aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-05-14 09:44:43 +0200
committerEike Ziller <eike.ziller@qt.io>2018-05-14 09:44:43 +0200
commit2278ebed1e0d290861a5616f4238eeec68607443 (patch)
treee1e475b97c1cbe461c38a502c23afb8c9c49b2b1 /tests
parentb67db8bc221a9b2a413cf9748ab0239a17ccb683 (diff)
parent3cfc715d7d33b724ad896c540af4a914d922e9bc (diff)
Merge remote-tracking branch 'origin/4.6' into 4.7
Conflicts: qbs/modules/qtc/qtc.qbs qtcreator.pri src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp Change-Id: I873a2fa112321225e7b478739fc017b01d24ce18
Diffstat (limited to 'tests')
-rw-r--r--tests/system/README4
-rw-r--r--tests/system/shared/classes.py5
-rw-r--r--tests/system/shared/project_explorer.py81
-rw-r--r--tests/system/shared/utils.py20
-rw-r--r--tests/system/suite_debugger/tst_debug_empty_main/test.py9
-rw-r--r--tests/system/suite_debugger/tst_qml_locals/test.py10
-rw-r--r--tests/system/suite_debugger/tst_simple_analyze/test.py11
-rw-r--r--tests/system/suite_general/tst_installed_languages/test.py19
-rw-r--r--tests/system/suite_general/tst_installed_languages/testdata/languages.tsv24
9 files changed, 29 insertions, 154 deletions
diff --git a/tests/system/README b/tests/system/README
index 86f5a1053dd..9988635940a 100644
--- a/tests/system/README
+++ b/tests/system/README
@@ -76,8 +76,8 @@ Attention! If any of these prerequisites cannot be satisfied the tests will like
Prerequisites - debugging and analyzing
-----------------------------------------
-In some tests, Creator needs to read data from an application it started.
-On Windows, those have the following prerequisites:
+In tst_simple_debug from suite_debbugger, Creator needs to read data from an application it
+started. On Windows, this has the following prerequisites:
Either:
* have no firewall at all enabled (sure that's a bad idea)
Or:
diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py
index c9a84e5c242..398928366e2 100644
--- a/tests/system/shared/classes.py
+++ b/tests/system/shared/classes.py
@@ -118,11 +118,6 @@ class ViewConstants:
return None
return toolTip % (viewTab + 1)
-class QtInformation:
- QT_VERSION = 0
- QT_BINPATH = 1
- QT_LIBPATH = 2
-
class LibType:
SHARED = 0
STATIC = 1
diff --git a/tests/system/shared/project_explorer.py b/tests/system/shared/project_explorer.py
index c506690d70f..dc18935e317 100644
--- a/tests/system/shared/project_explorer.py
+++ b/tests/system/shared/project_explorer.py
@@ -157,64 +157,13 @@ def getQtInformationForBuildSettings(kitCount, alreadyOnProjectsBuildSettings=Fa
qmakeCallLabel = waitForObject("{text?='<b>qmake:</b> qmake*' type='QLabel' unnamed='1' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}")
- mkspec = __getMkspecFromQMakeCall__(str(qmakeCallLabel.text))
- qtVersion = getQtInformationByQMakeCall(qtDir, QtInformation.QT_VERSION)
- qtLibPath = getQtInformationByQMakeCall(qtDir, QtInformation.QT_LIBPATH)
- qtBinPath = getQtInformationByQMakeCall(qtDir, QtInformation.QT_BINPATH)
+ qtVersion = getQtInformationByQMakeCall(qtDir)
if afterSwitchTo:
if ViewConstants.FIRST_AVAILABLE <= afterSwitchTo <= ViewConstants.LAST_AVAILABLE:
switchViewTo(afterSwitchTo)
else:
test.warning("Don't know where you trying to switch to (%s)" % afterSwitchTo)
- return qtVersion, mkspec, qtBinPath, qtLibPath
-
-def getQtInformationForQmlProject():
- fancyToolButton = waitForObject(":*Qt Creator_Core::Internal::FancyToolButton")
- kit = __getTargetFromToolTip__(str(fancyToolButton.toolTip))
- if not kit:
- test.fatal("Could not figure out which kit you're using...")
- return None
- test.log("Searching for Qt information for kit '%s'" % kit)
- invokeMenuItem("Tools", "Options...")
- waitForObjectItem(":Options_QListView", "Build & Run")
- clickItem(":Options_QListView", "Build & Run", 14, 15, 0, Qt.LeftButton)
- clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Kits")
- targetsTreeView = waitForObject(":BuildAndRun_QTreeView")
- if not __selectTreeItemOnBuildAndRun__(targetsTreeView, "%s(\s\(default\))?" % kit, True):
- test.fatal("Found no matching kit - this shouldn't happen.")
- clickButton(waitForObject(":Options.Cancel_QPushButton"))
- return None
- qtVersionStr = str(waitForObject(":Kits_QtVersion_QComboBox").currentText)
- test.log("Kit '%s' uses Qt Version '%s'" % (kit, qtVersionStr))
- clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Qt Versions")
- treeView = waitForObject(":qtdirList_QTreeView")
- if not __selectTreeItemOnBuildAndRun__(treeView, qtVersionStr):
- test.fatal("Found no matching Qt Version for kit - this shouldn't happen.")
- clickButton(waitForObject(":Options.Cancel_QPushButton"))
- return None
- qmake = str(waitForObject(":QtSupport__Internal__QtVersionManager.qmake_QLabel").text)
- test.log("Qt Version '%s' uses qmake at '%s'" % (qtVersionStr, qmake))
- clickButton(waitForObject(":Options.Cancel_QPushButton"))
- return qmake
-
-def __selectTreeItemOnBuildAndRun__(treeViewOrWidget, itemText, isRegex=False):
- model = treeViewOrWidget.model()
- test.compare(model.rowCount(), 2, "Verifying expected section count")
- autoDetected = model.index(0, 0)
- test.compare(autoDetected.data().toString(), "Auto-detected", "Verifying label for section")
- manual = model.index(1, 0)
- test.compare(manual.data().toString(), "Manual", "Verifying label for section")
- if isRegex:
- pattern = re.compile(itemText)
- for section in [autoDetected, manual]:
- for dumpedItem in dumpItems(model, section):
- if (isRegex and pattern.match(dumpedItem)
- or itemText == dumpedItem):
- item = ".".join([str(section.data().toString()),
- dumpedItem.replace(".", "\\.").replace("_", "\\_")])
- clickItem(treeViewOrWidget, item, 5, 5, 0, Qt.LeftButton)
- return True
- return False
+ return qtVersion
def __getTargetFromToolTip__(toolTip):
if toolTip == None or not isinstance(toolTip, (str, unicode)):
@@ -240,20 +189,10 @@ def getExecutableAndTargetFromToolTip(toolTip):
return None, target
return exe.group(1).strip(), target
-def __getMkspecFromQMakeCall__(qmakeCall):
- qCall = qmakeCall.split("</b>")[1].strip()
- tmp = qCall.split()
- for i in range(len(tmp)):
- if tmp[i] == '-spec' and i + 1 < len(tmp):
- return tmp[i + 1]
- test.fatal("Couldn't get mkspec from qmake call '%s'" % qmakeCall)
- return None
-
-# this function queries information from qmake
+# this function queries the version number from qmake
# param qtDir set this to a path that holds a valid Qt
-# param which set this to one of the QtInformation "constants"
# the function will return the wanted information or None if something went wrong
-def getQtInformationByQMakeCall(qtDir, which):
+def getQtInformationByQMakeCall(qtDir):
qmake = os.path.join(qtDir, "bin", "qmake")
if platform.system() in ('Microsoft', 'Windows'):
qmake += ".exe"
@@ -261,17 +200,7 @@ def getQtInformationByQMakeCall(qtDir, which):
test.fatal("Given Qt directory does not exist or does not contain bin/qmake.",
"Constructed path: '%s'" % qmake)
return None
- query = ""
- if which == QtInformation.QT_VERSION:
- query = "QT_VERSION"
- elif which == QtInformation.QT_BINPATH:
- query = "QT_INSTALL_BINS"
- elif which == QtInformation.QT_LIBPATH:
- query = "QT_INSTALL_LIBS"
- else:
- test.fatal("You're trying to fetch an unknown information (%s)" % which)
- return None
- return getOutputFromCmdline([qmake, "-query", query]).strip()
+ return getOutputFromCmdline([qmake, "-query", "QT_VERSION"]).strip()
def invokeContextMenuOnProject(projectName, menuItem):
try:
diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py
index c8bd71da6fc..0b8fb5818fa 100644
--- a/tests/system/shared/utils.py
+++ b/tests/system/shared/utils.py
@@ -114,6 +114,7 @@ def selectFromLocator(filter, itemName = None):
# clicking the wanted item
# if you replace this by pressing ENTER, be sure that something is selected
# otherwise you will run into unwanted behavior
+ snooze(1)
wantedItem = waitForObjectItem("{type='QTreeView' unnamed='1' visible='1'}", itemName)
doubleClick(wantedItem, 5, 5, 0, Qt.LeftButton)
@@ -176,21 +177,10 @@ def invokeMenuItem(menu, item, *subItems):
waitForObject(":Qt Creator.QtCreator.MenuBar_QMenuBar", 2000)
except:
nativeMouseClick(waitForObject(":Qt Creator_Core::Internal::MainWindow", 1000), 20, 20, 0, Qt.LeftButton)
- # HACK as Squish fails to provide a proper way to access the system menu
- if platform.system() == "Darwin":
- if menu == "Tools" and item == "Options...":
- #nativeType("<Command+,>")
- # the following is a pure HACK because using the default key sequence seems to be broken
- # when running from inside Squish
- menuBar = waitForObject(":Qt Creator.QtCreator.MenuBar_QMenuBar", 500)
- nativeMouseClick(menuBar, 75, 5, 0, Qt.LeftButton)
- for _ in range(3):
- nativeType("<Down>")
- nativeType("<Return>")
- return
- if menu == "File" and item == "Exit":
- nativeType("<Command+q>")
- return
+ # Use Locator for menu items which wouldn't work on macOS
+ if menu == "Tools" and item == "Options..." or menu == "File" and item == "Exit":
+ selectFromLocator("t %s" % item, item)
+ return
menuObject = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar", menu)
snooze(1)
waitFor("menuObject.visible", 1000)
diff --git a/tests/system/suite_debugger/tst_debug_empty_main/test.py b/tests/system/suite_debugger/tst_debug_empty_main/test.py
index 230e3793a87..be7f15fc2f8 100644
--- a/tests/system/suite_debugger/tst_debug_empty_main/test.py
+++ b/tests/system/suite_debugger/tst_debug_empty_main/test.py
@@ -97,13 +97,6 @@ def performDebugging(projectName, checkedTargets):
invokeMenuItem("Build", "Rebuild All")
waitForCompile()
isMsvc = isMsvcConfig(len(checkedTargets), kit)
- if platform.system() in ('Microsoft' 'Windows'):
- switchViewTo(ViewConstants.PROJECTS)
- switchToBuildOrRunSettingsFor(len(checkedTargets), kit, ProjectSettings.BUILD)
- buildDir = os.path.join(str(waitForObject(":Qt Creator_Utils::BuildDirectoryLineEdit").text),
- "debug")
- switchViewTo(ViewConstants.EDIT)
- allowAppThroughWinFW(buildDir, projectName, None)
clickButton(waitForObject(":*Qt Creator.Start Debugging_Core::Internal::FancyToolButton"))
handleDebuggerWarnings(config, isMsvc)
waitForObject(":Qt Creator.DebugModeWidget_QSplitter")
@@ -118,5 +111,3 @@ def performDebugging(projectName, checkedTargets):
clickButton(waitForObject(":*Qt Creator.Continue_Core::Internal::FancyToolButton"))
__handleAppOutputWaitForDebuggerFinish__()
removeOldBreakpoints()
- if platform.system() in ('Microsoft' 'Windows'):
- deleteAppFromWinFW(buildDir, projectName, None)
diff --git a/tests/system/suite_debugger/tst_qml_locals/test.py b/tests/system/suite_debugger/tst_qml_locals/test.py
index 8431558d029..d78e02d48f7 100644
--- a/tests/system/suite_debugger/tst_qml_locals/test.py
+++ b/tests/system/suite_debugger/tst_qml_locals/test.py
@@ -60,14 +60,6 @@ def main():
ensureChecked("{container=':Qt Creator.scrollArea_QScrollArea' text='Enable QML' "
"type='QCheckBox' unnamed='1' visible='1'}")
switchViewTo(ViewConstants.EDIT)
- if platform.system() in ('Microsoft', 'Windows'):
- qmake = getQtInformationForQmlProject()
- if qmake == None:
- earlyExit("Could not figure out which qmake is used.")
- return
- qmlScenePath = os.path.abspath(os.path.dirname(qmake))
- qmlScene = "qmlscene.exe"
- allowAppThroughWinFW(qmlScenePath, qmlScene, None)
clickButton(fancyDebugButton)
locAndExprTV = waitForObject(":Locals and Expressions_Debugger::Internal::WatchTreeView")
# Locals and Expressions populates treeview only on demand - so the tree must be expanded
@@ -96,8 +88,6 @@ def main():
subItem = items
checkForExpectedValues(subItem, current[2], current[3])
clickButton(waitForObject(':Debugger Toolbar.Exit Debugger_QToolButton', 5000))
- if platform.system() in ('Microsoft', 'Windows'):
- deleteAppFromWinFW(qmlScenePath, qmlScene)
invokeMenuItem("File", "Exit")
def __unfoldTree__():
diff --git a/tests/system/suite_debugger/tst_simple_analyze/test.py b/tests/system/suite_debugger/tst_simple_analyze/test.py
index c366d535bc8..c1578ee55d9 100644
--- a/tests/system/suite_debugger/tst_simple_analyze/test.py
+++ b/tests/system/suite_debugger/tst_simple_analyze/test.py
@@ -67,7 +67,7 @@ def performTest(workingDir, projectName, targetCount, availableConfigs):
# switching from MSVC to MinGW build will fail on the clean step of 'Rebuild All' because
# of differences between MSVC's and MinGW's Makefile (so clean before switching kits)
invokeMenuItem('Build', 'Clean Project "%s"' % projectName)
- qtVersion = verifyBuildConfig(targetCount, kit, config, True, True, True)[0]
+ qtVersion = verifyBuildConfig(targetCount, kit, config, True, True, True)
test.log("Selected kit using Qt %s" % qtVersion)
# explicitly build before start debugging for adding the executable as allowed program to WinFW
invokeMenuItem("Build", "Rebuild All")
@@ -75,13 +75,6 @@ def performTest(workingDir, projectName, targetCount, availableConfigs):
if not checkCompile():
test.fatal("Compile had errors... Skipping current build config")
continue
- if platform.system() in ('Microsoft' 'Windows'):
- switchViewTo(ViewConstants.PROJECTS)
- switchToBuildOrRunSettingsFor(targetCount, kit, ProjectSettings.BUILD)
- buildDir = os.path.join(str(waitForObject(":Qt Creator_Utils::BuildDirectoryLineEdit").text),
- "debug")
- switchViewTo(ViewConstants.EDIT)
- allowAppThroughWinFW(buildDir, projectName, None)
switchViewTo(ViewConstants.DEBUG)
selectFromCombo(":Analyzer Toolbar.AnalyzerManagerToolBox_QComboBox", "QML Profiler")
recordButton = waitForObject("{container=':DebugModeWidget.Toolbar_QDockWidget' "
@@ -131,8 +124,6 @@ def performTest(workingDir, projectName, targetCount, availableConfigs):
elif str(model.index(row, colCalls).data()) == "2":
test.compare(model.index(row, colMedian).data(), model.index(row, colLongest).data(),
"For two calls, median and longest time must be the same.")
- if platform.system() in ('Microsoft' 'Windows'):
- deleteAppFromWinFW(buildDir, projectName, None)
progressBarWait(15000, False) # wait for "Build" progressbar to disappear
clickButton(waitForObject(":Analyzer Toolbar.Clear_QToolButton"))
test.verify(waitFor("model.rowCount() == 0", 3000), "Analyzer results cleared.")
diff --git a/tests/system/suite_general/tst_installed_languages/test.py b/tests/system/suite_general/tst_installed_languages/test.py
index d4869559e9b..3ec32bf3496 100644
--- a/tests/system/suite_general/tst_installed_languages/test.py
+++ b/tests/system/suite_general/tst_installed_languages/test.py
@@ -50,21 +50,10 @@ def main():
overrideStartApplication()
startApplication("qtcreator" + SettingsPath)
try:
- if platform.system() == 'Darwin':
- try:
- fileMenu = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar",
- testData.field(lang, "File"))
- activateItem(fileMenu)
- obj = waitForObject("{type='QMenu' visible='1'}")
- test.compare(str(obj.objectName), 'QtCreator.Menu.File',
- "Creator was running in %s translation" % languageName)
- activateItem(fileMenu)
- except:
- test.fail("Creator seems to be missing %s translation" % languageName)
- nativeType("<Command+q>")
- else:
- invokeMenuItem(testData.field(lang, "File"), testData.field(lang, "Exit"))
- test.passes("Creator was running in %s translation." % languageName)
+ # Use Locator for menu items which wouldn't work on macOS
+ exitCommand = testData.field(lang, "Exit")
+ selectFromLocator("t %s" % exitCommand.rstrip("(X)"), exitCommand)
+ test.passes("Creator was running in %s translation." % languageName)
except:
test.fail("Creator seems to be missing %s translation" % languageName)
sendEvent("QCloseEvent", ":Qt Creator_Core::Internal::MainWindow")
diff --git a/tests/system/suite_general/tst_installed_languages/testdata/languages.tsv b/tests/system/suite_general/tst_installed_languages/testdata/languages.tsv
index 0ab6a819857..6de7b8fc235 100644
--- a/tests/system/suite_general/tst_installed_languages/testdata/languages.tsv
+++ b/tests/system/suite_general/tst_installed_languages/testdata/languages.tsv
@@ -1,12 +1,12 @@
-"language" "File" "Exit" "ISO"
-"Czech (CzechRepublic)" "Soubor" "Ukončit" "cs_CZ"
-"Danish (Denmark)" "Fil" "Afslut" "da_DK"
-"German (Germany)" "Datei" "Beenden" "de_DE"
-"French (France)" "Fichier" "Quitter" "fr_FR"
-"Japanese (Japan)" "ファイル(F)" "終了(X)" "ja_JP"
-"Polish (Poland)" "Plik" "Zakończ" "pl_PL"
-"Russian (%1)" "Файл" "Выход" "ru_RU"
-"Slovenian (Slovenia)" "Datoteka" "Končaj" "sl_SL"
-"Ukrainian (Ukraine)" "Файл" "Вийти" "uk_UA"
-"Chinese (China)" "文件(F)" "退出(X)" "zh_CN"
-"Chinese (Taiwan)" "檔案(F)" "離開(X)" "zh_TW"
+"language" "Exit" "ISO"
+"Czech (CzechRepublic)" "Ukončit" "cs_CZ"
+"Danish (Denmark)" "Afslut" "da_DK"
+"German (Germany)" "Beenden" "de_DE"
+"French (France)" "Quitter" "fr_FR"
+"Japanese (Japan)" "終了(X)" "ja_JP"
+"Polish (Poland)" "Zakończ" "pl_PL"
+"Russian (%1)" "Выход" "ru_RU"
+"Slovenian (Slovenia)" "Končaj" "sl_SL"
+"Ukrainian (Ukraine)" "Вийти" "uk_UA"
+"Chinese (China)" "退出(X)" "zh_CN"
+"Chinese (Taiwan)" "離開(X)" "zh_TW"