aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-05-02 15:22:16 +0200
committerEike Ziller <eike.ziller@qt.io>2018-05-02 15:22:16 +0200
commit4749a919a65fb4588b0b1def352bc80d24704db2 (patch)
tree6e14eaf12e23b151b520bdf235fea62bb2fb3dc9
parentc46b6dbb5661e9f3d16310da381909376e8e9a6b (diff)
parente8b13fe3c9e0984817d6b7417b43964c0433fcdd (diff)
Merge remote-tracking branch 'origin/4.6'
-rw-r--r--dist/changes-4.6.1.md36
-rwxr-xr-xscripts/deployqt.py8
-rw-r--r--src/plugins/coreplugin/locator/locatorwidget.cpp7
-rw-r--r--src/plugins/valgrind/memchecktool.cpp4
m---------src/shared/qbs0
-rw-r--r--tests/system/README89
-rw-r--r--tests/system/objects.map6
-rw-r--r--tests/system/shared/classes.py25
-rw-r--r--tests/system/shared/debugger.py67
-rw-r--r--tests/system/shared/hook_utils.py403
-rw-r--r--tests/system/shared/project.py117
-rw-r--r--tests/system/shared/project_explorer.py12
-rw-r--r--tests/system/shared/qtcreator.py1
-rw-r--r--tests/system/shared_data/qt_squish_mapping.tsv1
-rw-r--r--tests/system/suite_debugger/tst_qml_locals/test.py2
-rw-r--r--tests/system/suite_qtquick/tst_qtquick_creation/test.py26
-rw-r--r--tests/system/suite_qtquick/tst_qtquick_creation3/test.py19
17 files changed, 134 insertions, 689 deletions
diff --git a/dist/changes-4.6.1.md b/dist/changes-4.6.1.md
index 091d36ba68..608cc1fd0e 100644
--- a/dist/changes-4.6.1.md
+++ b/dist/changes-4.6.1.md
@@ -17,19 +17,28 @@ Editing
* Fixed crash when closing file with generic highlighting (QTCREATORBUG-20247)
+Help
+
+* Fixed crash when searching while indexing documentation
+ (QTCREATORBUG-20295)
+
All Projects
* Fixed that `.qrc` files were not listed as project files in Locator and
searches (QTCREATORBUG-20220)
+* Fixed removal of project directory items from `File System` pane
+ (QTCREATORBUG-20314)
QMake Projects
* Fixed that run and build buttons could stay disabled after project parsing
(QTCREATORBUG-20203)
+* Fixed reparsing project after changing target (QTCREATORBUG-20113)
CMake Projects
* Fixed that build steps for `clean` were missing (QTCREATORBUG-19823)
+* Fixed path to executable when adding CMake targets (QTCREATORBUG-19792)
Qbs Projects
@@ -75,3 +84,30 @@ Android
* Fixed deployment issue for 32-bit applications (QTCREATORBUG-20084)
* Fixed crash when trying to set up a broken NDK (QTCREATORBUG-20217)
* Fixed debugging on Android 8 or later
+* Fixed failure to install over existing app with different certificate
+ (QTCREATORBUG-17414)
+* Fixed creation of AVDs with `google-apis` system image (QTCREATORBUG-20298)
+* Fixed AVD Manager issue when `JAVA_HOME` environment variable is not set
+ (QTCREATORBUG-19988)
+
+Credits for these changes go to:
+Alessandro Portale
+Andre Hartmann
+BogDan Vatra
+Christian Kandeler
+Christian Stenger
+David Schulz
+Eike Ziller
+Ivan Donchevskii
+Jaroslaw Kobus
+Leena Miettinen
+Morten Johan Sørvig
+Nikolai Kosjar
+Orgad Shaneh
+Oswald Buddenhagen
+Robert Löhning
+Thomas Hartmann
+Tim Jenssen
+Tobias Hunger
+Ulf Hermann
+Vikas Pachdha
diff --git a/scripts/deployqt.py b/scripts/deployqt.py
index 6f6d5449f6..35c664b37e 100755
--- a/scripts/deployqt.py
+++ b/scripts/deployqt.py
@@ -310,8 +310,12 @@ def main():
QT_INSTALL_TRANSLATIONS = qt_install_info['QT_INSTALL_TRANSLATIONS']
plugins = ['accessible', 'codecs', 'designer', 'iconengines', 'imageformats', 'platformthemes',
- 'platforminputcontexts', 'platforms', 'printsupport', 'sqldrivers', 'styles',
- 'xcbglintegrations', 'qmltooling']
+ 'platforminputcontexts', 'platforms', 'printsupport', 'qmltooling', 'sqldrivers', 'styles',
+ 'xcbglintegrations',
+ 'wayland-decoration-client',
+ 'wayland-graphics-integration-client',
+ 'wayland-shell-integration',
+ ]
imports = ['Qt', 'QtWebKit']
if common.is_windows_platform():
diff --git a/src/plugins/coreplugin/locator/locatorwidget.cpp b/src/plugins/coreplugin/locator/locatorwidget.cpp
index 780379d544..55be82072a 100644
--- a/src/plugins/coreplugin/locator/locatorwidget.cpp
+++ b/src/plugins/coreplugin/locator/locatorwidget.cpp
@@ -341,8 +341,11 @@ bool LocatorPopup::event(QEvent *event)
{
if (event->type() == QEvent::ParentChange)
updateWindow();
- // completion list resizes after first items are shown --> LayoutRequest
- else if (event->type() == QEvent::Show || event->type() == QEvent::LayoutRequest)
+ else if (event->type() == QEvent::Show)
+ // make sure the popup has correct position before it becomes visible
+ updateGeometry();
+ else if (event->type() == QEvent::LayoutRequest)
+ // completion list resizes after first items are shown --> LayoutRequest
QTimer::singleShot(0, this, &LocatorPopup::updateGeometry);
return QWidget::event(event);
}
diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp
index 29d9b84f72..e322b737fc 100644
--- a/src/plugins/valgrind/memchecktool.cpp
+++ b/src/plugins/valgrind/memchecktool.cpp
@@ -97,6 +97,7 @@
#include <QPushButton>
#include <QSpinBox>
#include <QStandardPaths>
+#include <QVBoxLayout>
#include <QWinEventNotifier>
#include <utils/winutils.h>
@@ -733,7 +734,8 @@ void MemcheckTool::heobAction()
if (Project *project = SessionManager::startupProject()) {
if (Target *target = project->activeTarget()) {
if (RunConfiguration *rc = target->activeRunConfiguration()) {
- if (kit = target->kit()) {
+ kit = target->kit();
+ if (kit) {
abi = ToolChainKitInformation::targetAbi(kit);
const Runnable runnable = rc->runnable();
diff --git a/src/shared/qbs b/src/shared/qbs
-Subproject 508fce322c4715f32309e7ab959ef2630b73b55
+Subproject ece99a4c5f8710b11cd17ff48f4fc2d5ced645b
diff --git a/tests/system/README b/tests/system/README
index 703f11ea05..86f5a1053d 100644
--- a/tests/system/README
+++ b/tests/system/README
@@ -74,98 +74,17 @@ Use the settings in System Preferences > Keyboard > Input Sources to install mis
Attention! If any of these prerequisites cannot be satisfied the tests will likely fail (or not run at all).
-Prerequisites - hooking into subprocesses
+Prerequisites - debugging and analyzing
-----------------------------------------
-The usage of the hook-into subprocess has following prerequisites:
+In some tests, Creator needs to read data from an application it started.
+On Windows, those have the following prerequisites:
Either:
* have no firewall at all enabled (sure that's a bad idea)
Or:
+ * run Windows with English UI
* have the Windows Firewall enabled (no other firewalls are handled by the scripts)
* run the Squish tests with administrator privileges
* additionally the UAC should be disabled, too
Otherwise you'll have some trouble with popping up dialogs from the firewall.
If you're using a different firewall - try to figure out and add a rule for this.
-
-
-Using the internal test data fallback
--------------------------------------
-
- * inside the shared_data folder a "standard" mapping file is located (qt_squish_mapping.tsv)
- * this file defines currently some Squish versions that are available for usage
- * all of the Squish versions mentioned in there should exist inside QtSDK/src/creator-test-data (see the file for naming the Squish versions) - of course this depends on the OS you're testing on
-
-Attention! This file will be updated with more columns (and rows) for making it possible to also test Debug builds or 64bit builds. So, even the path entries currently listed could change when this feature is implemented.
-
-
-Using QT_SQUISH_MAPFILE variable
---------------------------------
-
- * create a simple text file (UTF-8 encoded) that follows this scheme:
-
- SquishVersion QtVersion mkspec Path
-
- * SquishVersion: only major and minor number will be used (e.g. 4.1, 4.2)
- * QtVersion: only major and minor number will be used (e.g. 4.7, 4.8, 5.0)
- * mkspec: a string holding the mkspec as it appears inside QTSDK/mkspec (or inside Qt Creator)
- * Path: the path to the Squish directory that can be used with this combination of QtVersion and mkspec
- * between QtVersion and mkspec as well as between mkspec and Path use whitespaces only
- * lines STARTING with # within the first column will be ignored
- * path can contain spaces as well as ~ (for the home directory)
- * you can put any entry of a line into quotes (no matter whether single or double quotes)
- * a line holding a mapping MUST start with a QtVersion entry in the first column
-
-Example 1: (using single space, no quoting)
-
-#squishversion qtversion mkspec path
-4.1<SP>4.7<SP>win32-g++<SP>C:\Tools\Squish_MinGW
-4.1<SP>4.7<SP>win32-msvc2008<SP>C:\Tools\Squish_MSVC9
-4.1<SP>4.7<SP>win32-msvc2010<SP>C:\Tools\Squish_MSVC10
-4.2<SP>4.8<SP>win32-g++<SP>C:\Tools\Squish_MinGW
-4.2<SP>4.8<SP>win32-msvc2008<SP>C:\Tools\Squish_MSVC9
-4.2<SP>4.8<SP>win32-msvc2010<SP>C:\Tools\Squish_MSVC10
-
-Example 2: (using mixed whitespaces, some quoting)
-
-#squishversion<SP>qtversion<TAB>mkspec<TAB><TAB><SP>path
-4.1<SP>"4.7"<SP><TAB>win32-g++<TAB><TAB>'C:\Tools\Squish_MinGW'
-4.1<SP>'4.7'<SP><TAB>'win32-msvc2008'<TAB>"C:\Tools\Squish_MSVC9"
-4.1<SP>4.7<SP><SP><TAB>win32-msvc2010<TAB>C:\Tools\Squish_MSVC10
-4.2<SP>"4.8"<SP><TAB>"win32-g++"<SP><SP><TAB>"C:\Tools\Squish_MinGW"
-4.2<SP>'4.8'<SP><TAB>win32-msvc2008<SP><TAB>'C:\Tools\Squish_MSVC9'
-4.2<SP>'4.8'<SP><TAB>win32-msvc2010<SP><TAB>C:\Tools\Squish_MSVC10
-
-Explanation: <SP> = space, <TAB> = tabulator
-
- * after creating this file put it somewhere and define environment variable QT_SQUISH_MAPFILE to point directly to the file
- * definition of this variable should be done BEFORE the test is started and can be done in various ways:
- * declare this variable as a system environment variable (how to do this depends on the OS you're using) [recommended way]
- * add this variable to the envvar file inside the directory holding the Squish test suites [please don't do this when pushing envvar back to git]
- * you can also modify the os.environ dict inside the test script(s) but this has to be done, before the test tries to read the variable [best place would be right before/after the call to startApplication()]
-
-Hint: You can also use the provided tsv file as a template. Simply remove lines you're not needing and adjust the path entries to point to the correct paths on your system and you should be fine.
-
-Attention! The format of the file might slightly change as soon also Debug builds will be easily testable (and maybe again for 64bit builds)
-
-
-Preparation of the SQUISH directories
--------------------------------------
-To make the hook-into sub-process really work you have to provide a modified Squish.
-
-Steps to set up the Squish directories on Windows:
- * get the Squish version you need from froglogic.com
- * extract the archive to place of your choice
- * go to the bin directory of Squish and remove the following dll's (Windows-only):
- * Qt3Support.dll
- * QtCore4.dll
- * QtGui4.dll
- * QtNetwork4.dll
- * QtSql4.dll
- * QtXml4.dll
- * remove all folders from the Squish root folder except bin, etc, lib and python - and on
- Windows you have to keep the VC runtime folder (Microsoft.VC??.CRT)
- (if you're using other script languages you have to keep them as well)
- * you can remove regular files from Squish root as well
- (but it's recommended to keep the buildinfo.txt for later verifications)
-
-You can additionally remove the complete ide folder as well as squishclassicide.exe and squishide.exe (to safe disk space).
diff --git a/tests/system/objects.map b/tests/system/objects.map
index 2a0dcca039..dc19df3739 100644
--- a/tests/system/objects.map
+++ b/tests/system/objects.map
@@ -61,9 +61,7 @@
:Dialog.componentNameEdit_QLineEdit {name='componentNameEdit' type='Utils::ClassNameValidatingLineEdit' visible='1' window=':Dialog_QmlJSEditor::Internal::ComponentNameDialog'}
:Dialog_Debugger::Internal::SymbolPathsDialog {name='Debugger__Internal__SymbolPathsDialog' type='Debugger::Internal::SymbolPathsDialog' visible='1' windowTitle='Dialog'}
:Dialog_QmlJSEditor::Internal::ComponentNameDialog {name='QmlJSEditor__Internal__ComponentNameDialog' type='QmlJSEditor::Internal::ComponentNameDialog' visible='1' windowTitle='Move Component into Separate File'}
-:Edit Environment_ProjectExplorer::EnvironmentItemsDialog {type='ProjectExplorer::EnvironmentItemsDialog' unnamed='1' visible='1' windowTitle='Edit Environment'}
:Events.QmlProfilerEventsTable_QmlProfiler::Internal::QmlProfilerStatisticsMainView {container=':Qt Creator.Events_QDockWidget' name='QmlProfilerEventsTable' type='QmlProfiler::Internal::QmlProfilerStatisticsMainView' visible='1'}
-:Executable:_Utils::PathChooser {buddy=':scrollArea.Executable:_QLabel' type='Utils::PathChooser' unnamed='1' visible='1'}
:Failed to start application_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='Failed to start application'}
:File has been removed.Close_QPushButton {text='Close' type='QPushButton' unnamed='1' visible='1' window=':File has been removed_QMessageBox'}
:File has been removed.Save_QPushButton {text='Save' type='QPushButton' unnamed='1' visible='1' window=':File has been removed_QMessageBox'}
@@ -159,7 +157,6 @@
:Qt Creator_HelpSelector_QComboBox {occurrence='3' type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Issues_Core::Internal::OutputPaneToggleButton {occurrence='1' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_QHelpContentWidget {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
-:Qt Creator_QTableView {type='QTableView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_QmlJSEditor::Internal::QmlJSOutlineTreeView {type='QmlJSEditor::Internal::QmlJSOutlineTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_QmlJSEditor::QmlJSTextEditorWidget {type='QmlJSEditor::Internal::QmlJSEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_SearchResult_Core::Internal::OutputPaneToggleButton {occurrence='2' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
@@ -181,8 +178,6 @@
:Restart required_QMessageBox {text='The language change will take effect after restart.' type='QMessageBox' unnamed='1' visible='1'}
:Revert to Saved.Proceed_QPushButton {text='Proceed' type='QPushButton' unnamed='1' visible='1' window=':Revert to Saved_QMessageBox'}
:Revert to Saved_QMessageBox {text?='You will lose your current changes if you proceed reverting*' type='QMessageBox' unnamed='1' visible='1'}
-:RunSettingsEnvironmentDetails_Utils::DetailsButton {leftWidget=':RunSettingsUseBuildEnvironment_QLabel' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
-:RunSettingsUseBuildEnvironment_QLabel {text~='Us(e|ing) <b>Build Environment</b>' type='QLabel' unnamed='1' visible='1'}
:Save Changes.Always save files before build_QCheckBox {name='saveBeforeBuildCheckBox' text='Always save files before build' type='QCheckBox' visible='1' window=':Save Changes_Core::Internal::SaveItemsDialog'}
:Save Changes.Do not Save_QPushButton {text='Do Not Save' type='QPushButton' unnamed='1' visible='1' window=':Save Changes_Core::Internal::SaveItemsDialog'}
:Save Changes.Save All_QPushButton {text='Save All' type='QPushButton' unnamed='1' visible='1' window=':Save Changes_Core::Internal::SaveItemsDialog'}
@@ -226,7 +221,6 @@
:scrollArea.Details_Utils::DetailsButton {text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:scrollArea.Edit build configuration:_QComboBox {leftWidget=':scrollArea.Edit build configuration:_QLabel' type='QComboBox' unnamed='1' visible='1'}
:scrollArea.Edit build configuration:_QLabel {text='Edit build configuration:' type='QLabel' unnamed='1' visible='1'}
-:scrollArea.Executable:_QLabel {container=':Qt Creator.scrollArea_QScrollArea' text='Executable:' type='QLabel' unnamed='1' visible='1'}
:scrollArea.Library not available_QLabel {name='qmlDebuggingWarningText' text?='Library not available*' type='QLabel' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:scrollArea.environment_QTreeView {container=':Qt Creator.scrollArea_QScrollArea' type='QTreeView' unnamed='1' visible='1'}
:scrollArea.qmlDebuggingLibraryCheckBox_QCheckBox {name='qmlDebuggingLibraryCheckBox' type='QCheckBox' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py
index c18173eea6..c9a84e5c24 100644
--- a/tests/system/shared/classes.py
+++ b/tests/system/shared/classes.py
@@ -118,31 +118,6 @@ class ViewConstants:
return None
return toolTip % (viewTab + 1)
-class SubprocessType:
- QT_WIDGET=0
- QT_QUICK_APPLICATION=1
- QT_QUICK_UI=2
- USER_DEFINED=3
-
- @staticmethod
- def getWindowType(subprocessType, qtQuickVersion="1.1"):
- if subprocessType == SubprocessType.QT_WIDGET:
- return "QMainWindow"
- if subprocessType == SubprocessType.QT_QUICK_APPLICATION:
- qqv = "2"
- if qtQuickVersion[0] == "1":
- qqv = "1"
- return "QtQuick%sApplicationViewer" % qqv
- if subprocessType == SubprocessType.QT_QUICK_UI:
- if qtQuickVersion == "1.1":
- return "QDeclarativeViewer"
- else:
- return "QQuickView"
- if subprocessType == SubprocessType.USER_DEFINED:
- return "user-defined"
- test.fatal("Could not determine the WindowType for SubprocessType %s" % subprocessType)
- return None
-
class QtInformation:
QT_VERSION = 0
QT_BINPATH = 1
diff --git a/tests/system/shared/debugger.py b/tests/system/shared/debugger.py
index 41f7bdc598..0ff993d27d 100644
--- a/tests/system/shared/debugger.py
+++ b/tests/system/shared/debugger.py
@@ -253,3 +253,70 @@ def verifyBreakPoint(bpToVerify):
else:
test.fatal("Expected a dict for bpToVerify - got '%s'" % className(bpToVerify))
return False
+
+# helper to check whether win firewall is running or not
+# this doesn't check for other firewalls!
+def __isWinFirewallRunning__():
+ if hasattr(__isWinFirewallRunning__, "fireWallState"):
+ return __isWinFirewallRunning__.fireWallState
+ if not platform.system() in ('Microsoft' 'Windows'):
+ __isWinFirewallRunning__.fireWallState = False
+ return False
+ result = getOutputFromCmdline(["netsh", "firewall", "show", "state"])
+ for line in result.splitlines():
+ if "Operational mode" in line:
+ __isWinFirewallRunning__.fireWallState = not "Disable" in line
+ return __isWinFirewallRunning__.fireWallState
+ return None
+
+# helper that can modify the win firewall to allow a program to communicate through it or delete it
+# param addToFW defines whether to add (True) or delete (False) this program to/from the firewall
+def __configureFW__(workingDir, projectName, isReleaseBuild, addToFW=True):
+ if isReleaseBuild == None:
+ if projectName[-4:] == ".exe":
+ projectName = projectName[:-4]
+ path = "%s%s%s" % (workingDir, os.sep, projectName)
+ elif isReleaseBuild:
+ path = "%s%s%s%srelease%s%s" % (workingDir, os.sep, projectName, os.sep, os.sep, projectName)
+ else:
+ path = "%s%s%s%sdebug%s%s" % (workingDir, os.sep, projectName, os.sep, os.sep, projectName)
+ if addToFW:
+ mode = "add"
+ enable = "ENABLE"
+ else:
+ mode = "delete"
+ enable = ""
+ projectName = ""
+ # Needs admin privileges on Windows 7
+ # Using the deprecated "netsh firewall" because the newer
+ # "netsh advfirewall" would need admin privileges on Windows Vista, too.
+ return subprocess.call(["netsh", "firewall", mode, "allowedprogram",
+ "%s.exe" % path, projectName, enable])
+
+# function to add a program to allow communication through the win firewall
+# param workingDir this directory is the parent of the project folder
+# param projectName this is the name of the project (the folder inside workingDir as well as the name for the executable)
+# param isReleaseBuild should currently always be set to True (will later add debug build testing)
+def allowAppThroughWinFW(workingDir, projectName, isReleaseBuild=True):
+ if not __isWinFirewallRunning__():
+ return
+ # WinFirewall seems to run - hopefully no other
+ result = __configureFW__(workingDir, projectName, isReleaseBuild)
+ if result == 0:
+ test.log("Added %s to firewall" % projectName)
+ else:
+ test.fatal("Could not add %s as allowed program to win firewall" % projectName)
+
+# function to delete a (former added) program from the win firewall
+# param workingDir this directory is the parent of the project folder
+# param projectName this is the name of the project (the folder inside workingDir as well as the name for the executable)
+# param isReleaseBuild should currently always be set to True (will later add debug build testing)
+def deleteAppFromWinFW(workingDir, projectName, isReleaseBuild=True):
+ if not __isWinFirewallRunning__():
+ return
+ # WinFirewall seems to run - hopefully no other
+ result = __configureFW__(workingDir, projectName, isReleaseBuild, False)
+ if result == 0:
+ test.log("Deleted %s from firewall" % projectName)
+ else:
+ test.warning("Could not delete %s as allowed program from win firewall" % (projectName))
diff --git a/tests/system/shared/hook_utils.py b/tests/system/shared/hook_utils.py
deleted file mode 100644
index 9f571d27e0..0000000000
--- a/tests/system/shared/hook_utils.py
+++ /dev/null
@@ -1,403 +0,0 @@
-############################################################################
-#
-# Copyright (C) 2016 The Qt Company Ltd.
-# Contact: https://www.qt.io/licensing/
-#
-# This file is part of Qt Creator.
-#
-# Commercial License Usage
-# Licensees holding valid commercial Qt licenses may use this file in
-# accordance with the commercial license agreement provided with the
-# Software or, alternatively, in accordance with the terms contained in
-# a written agreement between you and The Qt Company. For licensing terms
-# and conditions see https://www.qt.io/terms-conditions. For further
-# information use the contact form at https://www.qt.io/contact-us.
-#
-# GNU General Public License Usage
-# Alternatively, this file may be used under the terms of the GNU
-# General Public License version 3 as published by the Free Software
-# Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-# included in the packaging of this file. Please review the following
-# information to ensure the GNU General Public License requirements will
-# be met: https://www.gnu.org/licenses/gpl-3.0.html.
-#
-############################################################################
-
-import re
-
-# this function modifies all necessary run settings to make it possible to hook into
-# the application compiled by Creator
-def modifyRunSettingsForHookInto(projectName, kitCount, port):
- prepareBuildSettings(kitCount, 0)
- # this uses the default Qt version which Creator activates when opening the project
- switchViewTo(ViewConstants.PROJECTS)
- switchToBuildOrRunSettingsFor(kitCount, 0, ProjectSettings.BUILD)
- qtVersion, mkspec, qtBinPath, qtLibPath = getQtInformationForBuildSettings(kitCount, True)
- if None in (qtVersion, mkspec, qtBinPath, qtLibPath):
- test.fatal("At least one of the Qt information returned None - leaving...",
- "Qt version: %s, mkspec: %s, Qt BinPath: %s, Qt LibPath: %s" %
- (qtVersion, mkspec, qtBinPath, qtLibPath))
- return False
- qtVersion = ".".join(qtVersion.split(".")[:2])
- switchToBuildOrRunSettingsFor(kitCount, 0, ProjectSettings.RUN)
- result = __configureCustomExecutable__(projectName, port, mkspec, qtVersion)
- if result:
- ensureChecked(":RunSettingsEnvironmentDetails_Utils::DetailsButton")
- envVarsTableView = waitForObject("{type='QTreeView' visible='1' unnamed='1'}")
- model = envVarsTableView.model()
- changingVars = []
- for index in dumpIndices(model):
- # get var name
- envVarsTableView.scrollTo(index)
- varName = str(model.data(index).toString())
- # if its a special SQUISH var simply unset it, SQUISH_LIBQTDIR and PATH will be replaced with Qt paths
- if varName == "PATH":
- test.log("Replacing PATH with '%s'" % qtBinPath)
- changingVars.append("PATH=%s" % qtBinPath)
- elif varName.find("SQUISH") == 0:
- if varName == "SQUISH_LIBQTDIR":
- if platform.system() in ('Microsoft', 'Windows'):
- replacement = qtBinPath
- else:
- replacement = qtLibPath
- test.log("Replacing SQUISH_LIBQTDIR with '%s'" % replacement)
- changingVars.append("SQUISH_LIBQTDIR=%s" % replacement)
- else:
- changingVars.append(varName)
- elif varName == "DYLD_FRAMEWORK_PATH" and platform.system() == 'Darwin':
- value = str(model.data(model.index(index.row, 1)).toString())
- test.log("Adding %s to DYLD_FRAMEWORK_PATH" % qtLibPath)
- replacement = ":".join(filter(len, [qtLibPath, value]))
- changingVars.append("%s=%s" % (varName, replacement))
- batchEditRunEnvironment(kitCount, 0, changingVars, True)
- switchViewTo(ViewConstants.EDIT)
- return result
-
-def batchEditRunEnvironment(kitCount, currentTarget, modifications, alreadyOnRunSettings=False):
- if not alreadyOnRunSettings:
- switchViewTo(ViewConstants.PROJECTS)
- switchToBuildOrRunSettingsFor(kitCount, currentTarget, ProjectSettings.RUN)
- ensureChecked(":RunSettingsEnvironmentDetails_Utils::DetailsButton")
- clickButton(waitForObject("{text='Batch Edit...' type='QPushButton' unnamed='1' visible='1' "
- "window=':Qt Creator_Core::Internal::MainWindow'}"))
- editor = waitForObject("{type='TextEditor::SnippetEditorWidget' unnamed='1' visible='1' "
- "window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}")
- typeLines(editor, modifications)
- clickButton(waitForObject("{text='OK' type='QPushButton' unnamed='1' visible='1' "
- "window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}"))
-
-def modifyRunSettingsForHookIntoQtQuickUI(kitCount, kit, workingDir, projectName, port, quickVersion="1.1"):
- switchViewTo(ViewConstants.PROJECTS)
- switchToBuildOrRunSettingsFor(kitCount, kit, ProjectSettings.RUN)
-
- qtVersion, mkspec, qtLibPath, qmake = getQtInformationForQmlProject()
- if None in (qtVersion, mkspec, qtLibPath, qmake):
- test.fatal("At least one of the Qt information returned None - leaving...",
- "Qt version: %s, mkspec: %s, Qt LibPath: %s, qmake: '%s'"
- % (qtVersion, mkspec, qtLibPath, qmake))
- return None
-
- squishPath = getSquishPath(mkspec, qtVersion)
- if squishPath == None:
- test.warning("Could not determine the Squish path for %s/%s" % (qtVersion, mkspec),
- "Using fallback of pushing STOP inside Creator.")
- return None
- test.log("Using (QtVersion/mkspec) %s/%s with SquishPath %s" % (qtVersion, mkspec, squishPath))
- if quickVersion == "1.1":
- if platform.system() == "Darwin":
- executable = os.path.abspath(os.path.dirname(qmake) + "/QMLViewer.app")
- else:
- executable = os.path.abspath(os.path.dirname(qmake) + "/qmlviewer")
- else:
- executable = os.path.abspath(os.path.dirname(qmake) + "/qmlscene")
- if platform.system() in ('Microsoft', 'Windows'):
- executable = executable + ".exe"
- startAUT = os.path.abspath(squishPath + "/bin/startaut")
- if platform.system() in ('Microsoft', 'Windows'):
- startAUT = startAUT + ".exe"
- args = "--verbose --port=%d %s %s.qml" % (port, executable, projectName)
- projectPath = os.path.abspath("%s/%s" % (workingDir, projectName))
- __invokeAddCustomExecutable__(startAUT, args, projectPath)
- clickButton(waitForObject("{text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' "
- "window=':Qt Creator_Core::Internal::MainWindow' "
- "leftWidget={type='QLabel' text~='Us(e|ing) <b>Build Environment</b>'"
- " unnamed='1' visible='1'}}"))
- for varName in ("PATH", "SQUISH_LIBQTDIR"):
- __addVariableToRunEnvironment__(varName, qtLibPath)
- if not platform.system() in ('Microsoft', 'Windows', 'Darwin'):
- __addVariableToRunEnvironment__("LD_LIBRARY_PATH", qtLibPath)
- if platform.system() == "Darwin":
- __addVariableToRunEnvironment__("DYLD_FRAMEWORK_PATH", qtLibPath)
- if not platform.system() in ('Microsoft', 'Windows'):
- if not os.getenv("DISPLAY"):
- __addVariableToRunEnvironment__("DISPLAY", ":0.0")
- result = executable
- switchViewTo(ViewConstants.EDIT)
- return result
-
-# this helper method must be called on the run settings page of a Qt Quick UI with DetailsWidget
-# for the run settings already opened - it won't work on other views because of a different layout
-def __addVariableToRunEnvironment__(name, value):
- clickButton(waitForObject("{text='Add' type='QPushButton' unnamed='1' visible='1' "
- "container={window=':Qt Creator_Core::Internal::MainWindow' "
- "type='Utils::DetailsWidget' unnamed='1' visible='1' occurrence='2'}}"))
- varNameLineEd = waitForObject("{type='QExpandingLineEdit' visible='1' unnamed='1'}")
- doubleClick(varNameLineEd)
- replaceEditorContent(varNameLineEd, name)
- type(varNameLineEd, "<Return>")
- row = getTableRowOf(name, ":Qt Creator_QTableView")
- if row == -1:
- test.fatal("Could not find entered variable name inside table - skipping entering value.")
- return
- valueLineEd = __doubleClickQTableView__(":Qt Creator_QTableView", row, 1)
- replaceEditorContent(valueLineEd, value)
- type(valueLineEd, "<Return>")
-
-def getTableRowOf(value, table):
- tblModel = waitForObject(table).model()
- items = dumpItems(tblModel)
- if value in items:
- return items.index(value)
- else:
- return -1
-
-def __getMkspecFromQMakeConf__(qmakeConf):
- if qmakeConf==None or not os.path.exists(qmakeConf):
- return None
- if not platform.system() in ('Microsoft', 'Windows'):
- return os.path.basename(os.path.realpath(os.path.dirname(qmakeConf)))
- mkspec = None
- file = codecs.open(qmakeConf, "r", "utf-8")
- for line in file:
- if "QMAKESPEC_ORIGINAL" in line:
- mkspec = line.split("=")[1]
- break
- file.close()
- if mkspec == None:
- test.warning("Could not determine mkspec from '%s'" % qmakeConf)
- return None
- return os.path.basename(mkspec)
-
-def __getMkspecFromQmake__(qmakeCall):
- if getOutputFromCmdline([qmakeCall, "-query", "QT_VERSION"]).strip().startswith("5."):
- return getOutputFromCmdline([qmakeCall, "-query", "QMAKE_XSPEC"]).strip()
- else:
- QmakeConfPath = getOutputFromCmdline([qmakeCall, "-query", "QMAKE_MKSPECS"]).strip()
- for tmpPath in QmakeConfPath.split(os.pathsep):
- tmpPath = tmpPath + os.sep + "default" + os.sep +"qmake.conf"
- result = __getMkspecFromQMakeConf__(tmpPath)
- if result != None:
- return result.strip()
- test.warning("Could not find qmake.conf inside provided QMAKE_MKSPECS path",
- "QMAKE_MKSPECS returned: '%s'" % QmakeConfPath)
- return None
-
-# helper that double clicks the table view at specified row and column
-# returns the QExpandingLineEdit (the editable table cell)
-def __doubleClickQTableView__(qtableView, row, column):
- doubleClick(waitForObject("{container='%s' "
- "type='QModelIndex' row='%d' column='%d'}" % (qtableView, row, column)), 5, 5, 0, Qt.LeftButton)
- return waitForObject("{type='QExpandingLineEdit' visible='1' unnamed='1'}")
-
-# this function configures the custom executable onto the run settings page (using startaut from Squish)
-def __configureCustomExecutable__(projectName, port, mkspec, qmakeVersion):
- startAUT = getSquishPath(mkspec, qmakeVersion)
- if startAUT == None:
- test.warning("Something went wrong determining the right Squish for %s / %s combination - "
- "using fallback without hooking into subprocess." % (qmakeVersion, mkspec))
- return False
- else:
- startAUT = os.path.abspath(startAUT + "/bin/startaut")
- if platform.system() in ('Microsoft', 'Windows'):
- startAUT += ".exe"
- if not os.path.exists(startAUT):
- test.warning("Configured Squish directory seems to be missing - using fallback without hooking into subprocess.",
- "Failed to find '%s'" % startAUT)
- return False
- progressBarWait()
- # the following is currently only configured for release builds (will be enhanced later)
- if platform.system() in ('Microsoft', 'Windows'):
- debOrRel = "release" + os.sep
- else:
- debOrRel = ""
- args = "--verbose --port=%d %s%s" % (port, debOrRel, projectName)
- __invokeAddCustomExecutable__(startAUT, args)
- return True
-
-# get the Squish path that is needed to successfully hook into the compiled app
-def getSquishPath(mkspec, qmakev):
- # assuming major and minor version will be enough
- squishVersion = "%d.%d" % (squishinfo.major, squishinfo.minor)
- qmakev = ".".join(qmakev.split(".")[0:2])
- path = None
- mapfile = os.environ.get("QT_SQUISH_MAPFILE")
- if mapfile and os.path.isfile(mapfile):
- file = codecs.open(mapfile, "r", "utf-8")
- pattern = re.compile("\s+")
- for line in file:
- if line[0] == "#":
- continue
- tmp = pattern.split(line, 3)
- if (tmp[0].strip("'\"") == squishVersion and tmp[1].strip("'\"") == qmakev
- and tmp[2].strip("'\"") == mkspec):
- path = os.path.expanduser(tmp[3].strip().strip("'\""))
- break
- file.close()
- else:
- if not mapfile:
- test.warning("Environment variable QT_SQUISH_MAPFILE isn't set. Using fallback test data.",
- "See the README file how to use it.")
- else:
- test.warning("Environment variable QT_SQUISH_MAPFILE isn't set correctly or map file does not exist. Using fallback test data.",
- "See the README file how to use it.")
- # try the test data fallback
- mapData = testData.dataset(os.getcwd() + "/../../shared_data/qt_squish_mapping.tsv")
- for record in mapData:
- if (testData.field(record, "squishversion") == squishVersion and
- testData.field(record, "qtversion") == qmakev
- and testData.field(record, "mkspec") == mkspec):
- path = os.path.expanduser(testData.field(record, "path"))
- break
- if path == None:
- test.warning("Haven't found suitable Squish version with matching Qt version and mkspec.",
- "See the README file how to set up your environment.")
- elif not os.path.exists(path):
- test.warning("Squish path '%s' from fallback test data file does not exist!" % path,
- "See the README file how to set up your environment.")
- return None
- return path
-
-# function to add a program to allow communication through the win firewall
-# param workingDir this directory is the parent of the project folder
-# param projectName this is the name of the project (the folder inside workingDir as well as the name for the executable)
-# param isReleaseBuild should currently always be set to True (will later add debug build testing)
-def allowAppThroughWinFW(workingDir, projectName, isReleaseBuild=True):
- if not __isWinFirewallRunning__():
- return
- # WinFirewall seems to run - hopefully no other
- result = __configureFW__(workingDir, projectName, isReleaseBuild)
- if result == 0:
- test.log("Added %s to firewall" % projectName)
- else:
- test.fatal("Could not add %s as allowed program to win firewall" % projectName)
-
-# function to delete a (former added) program from the win firewall
-# param workingDir this directory is the parent of the project folder
-# param projectName this is the name of the project (the folder inside workingDir as well as the name for the executable)
-# param isReleaseBuild should currently always be set to True (will later add debug build testing)
-def deleteAppFromWinFW(workingDir, projectName, isReleaseBuild=True):
- if not __isWinFirewallRunning__():
- return
- # WinFirewall seems to run - hopefully no other
- result = __configureFW__(workingDir, projectName, isReleaseBuild, False)
- if result == 0:
- test.log("Deleted %s from firewall" % projectName)
- else:
- test.warning("Could not delete %s as allowed program from win firewall" % (projectName))
-
-# helper that can modify the win firewall to allow a program to communicate through it or delete it
-# param addToFW defines whether to add (True) or delete (False) this program to/from the firewall
-def __configureFW__(workingDir, projectName, isReleaseBuild, addToFW=True):
- if isReleaseBuild == None:
- if projectName[-4:] == ".exe":
- projectName = projectName[:-4]
- path = "%s%s%s" % (workingDir, os.sep, projectName)
- elif isReleaseBuild:
- path = "%s%s%s%srelease%s%s" % (workingDir, os.sep, projectName, os.sep, os.sep, projectName)
- else:
- path = "%s%s%s%sdebug%s%s" % (workingDir, os.sep, projectName, os.sep, os.sep, projectName)
- if addToFW:
- mode = "add"
- enable = "ENABLE"
- else:
- mode = "delete"
- enable = ""
- projectName = ""
- # Needs admin privileges on Windows 7
- # Using the deprecated "netsh firewall" because the newer
- # "netsh advfirewall" would need admin privileges on Windows Vista, too.
- return subprocess.call(["netsh", "firewall", mode, "allowedprogram",
- "%s.exe" % path, projectName, enable])
-
-# helper to check whether win firewall is running or not
-# this doesn't check for other firewalls!
-def __isWinFirewallRunning__():
- if hasattr(__isWinFirewallRunning__, "fireWallState"):
- return __isWinFirewallRunning__.fireWallState
- if not platform.system() in ('Microsoft' 'Windows'):
- __isWinFirewallRunning__.fireWallState = False
- return False
- result = getOutputFromCmdline(["netsh", "firewall", "show", "state"])
- for line in result.splitlines():
- if "Operational mode" in line:
- __isWinFirewallRunning__.fireWallState = not "Disable" in line
- return __isWinFirewallRunning__.fireWallState
- return None
-
-# this function adds the given executable as an attachable AUT
-# Bad: executable/port could be empty strings - you should be aware of this
-def addExecutableAsAttachableAUT(executable, port, host=None):
- if not __checkParamsForAttachableAUT__(executable, port):
- return False
- if host == None:
- host = "localhost"
- squishSrv = __getSquishServer__()
- if (squishSrv == None):
- return False
- result = subprocess.call([squishSrv, "--config", "addAttachableAUT",
- executable, "%s:%s" % (host, port)])
- if result == 0:
- test.passes("Added %s as attachable AUT" % executable)
- else:
- test.fail("Failed to add %s as attachable AUT" % executable)
- return result == 0
-
-# this function removes the given executable as an attachable AUT
-# Bad: executable/port could be empty strings - you should be aware of this
-def removeExecutableAsAttachableAUT(executable, port, host=None):
- if not __checkParamsForAttachableAUT__(executable, port):
- return False
- if host == None:
- host = "localhost"
- squishSrv = __getSquishServer__()
- if (squishSrv == None):
- return False
- result = subprocess.call([squishSrv, "--config", "removeAttachableAUT",
- executable, "%s:%s" % (host, port)])
- if result == 0:
- test.passes("Removed %s as attachable AUT" % executable)
- else:
- test.fail("Failed to remove %s as attachable AUT" % executable)
- return result == 0
-
-def __checkParamsForAttachableAUT__(executable, port):
- return port != None and executable != None
-
-def __getSquishServer__():
- squishSrv = currentApplicationContext().environmentVariable("SQUISH_PREFIX")
- if (squishSrv == ""):
- test.fatal("SQUISH_PREFIX isn't set - leaving test")
- return None
- return os.path.abspath(squishSrv + "/bin/squishserver")
-
-def __invokeAddCustomExecutable__(exe, args, workingDir=None):
- addButton = waitForObject("{container={window=':Qt Creator_Core::Internal::MainWindow' "
- "type='ProjectExplorer::Internal::RunSettingsWidget' unnamed='1' "
- "visible='1'} occurrence='2' text='Add' type='QPushButton' "
- "unnamed='1' visible='1'}")
- clickButton(addButton)
- addMenu = addButton.menu()
- activateItem(waitForObjectItem(addMenu, 'Custom Executable'))
- exePathChooser = waitForObject(":Executable:_Utils::PathChooser")
- exeLineEd = getChildByClass(exePathChooser, "Utils::FancyLineEdit")
- argLineEd = waitForObject("{buddy={window=':Qt Creator_Core::Internal::MainWindow' "
- "type='QLabel' text='Arguments:' visible='1'} type='QLineEdit' "
- "unnamed='1' visible='1'}")
- wdPathChooser = waitForObject("{buddy={window=':Qt Creator_Core::Internal::MainWindow' "
- "text='Working directory:' type='QLabel'} "
- "type='Utils::PathChooser' unnamed='1' visible='1'}")
- wdLineEd = getChildByClass(wdPathChooser, "Utils::FancyLineEdit")
- replaceEditorContent(exeLineEd, exe)
- replaceEditorContent(argLineEd, args)
- if workingDir:
- replaceEditorContent(wdLineEd, workingDir)
diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py
index 6004986a78..5219d675dd 100644
--- a/tests/system/shared/project.py
+++ b/tests/system/shared/project.py
@@ -483,20 +483,11 @@ def waitForProcessRunning(running=True):
return waitFor("(reRunButton.enabled != running) and (stopButton.enabled == running)", 10000)
# run and close an application
-# withHookInto - if set to True the function tries to attach to the sub-process instead of simply pressing Stop inside Creator
-# executable - must be defined when using hook-into
-# port - must be defined when using hook-into
-# function - can be a string holding a function name or a reference to the function itself - this function will be called on
-# the sub-process when hooking-into has been successful - if its missing simply closing the Qt Quick app will be done
-# sType the SubprocessType - is nearly mandatory - except when using the function parameter
-# userDefinedType - if you set sType to SubprocessType.USER_DEFINED you must(!) specify the WindowType for hooking into
-# by yourself (or use the function parameter)
-# ATTENTION! Make sure this function won't fail and the sub-process will end when the function returns
# returns None if the build failed, False if the subprocess did not start, and True otherwise
-def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None, sType=None, userDefinedType=None, quickVersion="1.1"):
+def runAndCloseApp(isQtQuickUI=False):
runButton = waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")
clickButton(runButton)
- if sType != SubprocessType.QT_QUICK_UI:
+ if not isQtQuickUI:
waitForCompile(300000)
buildSucceeded = checkLastBuild()
ensureChecked(waitForObject(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton"))
@@ -506,31 +497,10 @@ def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None
if not waitForProcessRunning():
test.fatal("Couldn't start application - leaving test")
return False
- if sType == SubprocessType.QT_QUICK_UI and os.getenv("SYSTEST_QMLVIEWER_NO_HOOK_INTO", "0") == "1":
- withHookInto = False
- if withHookInto and not validType(sType, userDefinedType, quickVersion):
- if function != None:
- test.warning("You did not provide a valid value for the SubprocessType value - sType, but you have "
- "provided a function to execute on the subprocess. Please ensure that your function "
- "closes the subprocess before exiting, or this test will not complete.")
- else:
- test.warning("You did not provide a valid value for the SubprocessType value - sType, nor a "
- "function to execute on the subprocess. Falling back to pushing the STOP button "
- "inside creator to terminate execution of the subprocess.")
- withHookInto = False
- if withHookInto and not executable in ("", None):
- __closeSubprocessByHookingInto__(executable, port, function, sType, userDefinedType, quickVersion)
- else:
- __closeSubprocessByPushingStop__(sType)
+ __closeSubprocessByPushingStop__(isQtQuickUI)
return True
-def validType(sType, userDef, quickVersion):
- if sType == None:
- return False
- ty = SubprocessType.getWindowType(sType, quickVersion)
- return ty != None and not (ty == "user-defined" and (userDef == None or userDef.strip() == ""))
-
-def __closeSubprocessByPushingStop__(sType):
+def __closeSubprocessByPushingStop__(isQtQuickUI):
ensureChecked(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton")
try:
waitForObject(":Qt Creator.Stop_QToolButton", 5000)
@@ -542,90 +512,13 @@ def __closeSubprocessByPushingStop__(sType):
clickButton(stopButton)
test.verify(waitFor("playButton.enabled", 5000), "Play button should be enabled")
test.compare(stopButton.enabled, False, "Stop button should be disabled")
- if sType == SubprocessType.QT_QUICK_UI and platform.system() == "Darwin":
+ if isQtQuickUI and platform.system() == "Darwin":
waitFor("stopButton.enabled==False")
snooze(2)
nativeType("<Escape>")
else:
test.fatal("Subprocess does not seem to have been started.")
-def __closeSubprocessByHookingInto__(executable, port, function, sType, userDefType, quickVersion):
- ensureChecked(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton")
- output = waitForObject("{type='Core::OutputWindow' visible='1' windowTitle='Application Output Window'}")
- if port == None:
- test.warning("I need a port number or attaching might fail.")
- else:
- waitFor("'Listening on port %d for incoming connectionsdone' in str(output.plainText)" % port, 5000)
- try:
- attachToApplication(executable)
- except:
- resetApplicationContextToCreator()
- if ("Loading Qt Wrapper failed" in str(output.plainText)
- or "Failed to assign process to job object" in str(output.plainText)):
- test.warning("Loading of Qt Wrapper failed - probably different Qt versions.",
- "Resetting hook-into settings to continue.")
- # assuming we're still on the build settings of the current project (TODO)
- switchViewTo(ViewConstants.PROJECTS)
- if sType == SubprocessType.QT_QUICK_UI:
- if "qmlscene" in executable:
- selectConfig = "QML Scene"
- else:
- selectConfig = "QML Viewer"
- else:
- selectConfig = executable
- selectFromCombo(waitForObject("{buddy={text='Run configuration:' type='QLabel' "
- "unnamed='1' visible='1'} type='QComboBox' unnamed='1' "
- "visible='1'}"), selectConfig)
- switchViewTo(ViewConstants.EDIT)
- runButton = waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")
- clickButton(runButton)
- if not waitForProcessRunning():
- test.fatal("Something seems to be really wrong.", "Application output:"
- % str(output.plainText))
- return False
- else:
- test.log("Application seems to be started without hooking-into.")
- else:
- test.warning("Could not attach to '%s' - using fallback of pushing STOP inside Creator." % executable)
- __closeSubprocessByPushingStop__(sType)
- return False
- if function == None:
- if sType==SubprocessType.USER_DEFINED:
- sendEvent("QCloseEvent", "{type='%s' unnamed='1' visible='1'}" % userDefType)
- else:
- sendEvent("QCloseEvent", "{type='%s' unnamed='1' visible='1'}" % SubprocessType.getWindowType(sType, quickVersion))
- resetApplicationContextToCreator()
- else:
- try:
- if isinstance(function, (str, unicode)):
- globals()[function]()
- else:
- function()
- except:
- test.fatal("Function to execute on sub-process could not be found.",
- "Using fallback of pushing STOP inside Creator.")
- resetApplicationContextToCreator()
- __closeSubprocessByPushingStop__(sType)
- resetApplicationContextToCreator()
- if not (waitForProcessRunning(False) and waitFor("'exited with code' in str(output.plainText)", 10000)):
- test.warning("Sub-process seems not to have closed properly.")
- try:
- __closeSubprocessByPushingStop__(sType)
- except:
- pass
- if (platform.system() in ('Microsoft', 'Windows') and
- 'Listening on port %d for incoming connectionsdone' % port not in str(output.plainText)):
- checkForStillRunningQmlExecutable([executable + ".exe"])
- return True
-
-# this helper tries to reset the current application context back
-# to creator - this strange work-around is needed _sometimes_ on MacOS
-def resetApplicationContextToCreator():
- appCtxt = applicationContext("qtcreator")
- if appCtxt.name == "":
- appCtxt = applicationContext("Qt Creator")
- setApplicationContext(appCtxt)
-
# helper that examines the text (coming from the create project wizard)
# to figure out which available targets we have
# Simulator must be handled in a special way, because this depends on the
diff --git a/tests/system/shared/project_explorer.py b/tests/system/shared/project_explorer.py
index 686d5722e2..c506690d70 100644
--- a/tests/system/shared/project_explorer.py
+++ b/tests/system/shared/project_explorer.py
@@ -173,7 +173,7 @@ def getQtInformationForQmlProject():
kit = __getTargetFromToolTip__(str(fancyToolButton.toolTip))
if not kit:
test.fatal("Could not figure out which kit you're using...")
- return None, None, None, None
+ return None
test.log("Searching for Qt information for kit '%s'" % kit)
invokeMenuItem("Tools", "Options...")
waitForObjectItem(":Options_QListView", "Build & Run")
@@ -183,7 +183,7 @@ def getQtInformationForQmlProject():
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, None, None, None
+ 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")
@@ -191,15 +191,11 @@ def getQtInformationForQmlProject():
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, None, None, None
+ return None
qmake = str(waitForObject(":QtSupport__Internal__QtVersionManager.qmake_QLabel").text)
test.log("Qt Version '%s' uses qmake at '%s'" % (qtVersionStr, qmake))
- qtDir = os.path.dirname(os.path.dirname(qmake))
- qtVersion = getQtInformationByQMakeCall(qtDir, QtInformation.QT_VERSION)
- qtLibPath = getQtInformationByQMakeCall(qtDir, QtInformation.QT_LIBPATH)
- mkspec = __getMkspecFromQmake__(qmake)
clickButton(waitForObject(":Options.Cancel_QPushButton"))
- return qtVersion, mkspec, qtLibPath, qmake
+ return qmake
def __selectTreeItemOnBuildAndRun__(treeViewOrWidget, itemText, isRegex=False):
model = treeViewOrWidget.model()
diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py
index 503298a5dc..c812ccd624 100644
--- a/tests/system/shared/qtcreator.py
+++ b/tests/system/shared/qtcreator.py
@@ -49,7 +49,6 @@ source("../../shared/build_utils.py")
source("../../shared/project.py")
source("../../shared/editor_utils.py")
source("../../shared/project_explorer.py")
-source("../../shared/hook_utils.py")
source("../../shared/debugger.py")
source("../../shared/clang.py")
source("../../shared/welcome.py")
diff --git a/tests/system/shared_data/qt_squish_mapping.tsv b/tests/system/shared_data/qt_squish_mapping.tsv
deleted file mode 100644
index 4d6d4ed86a..0000000000
--- a/tests/system/shared_data/qt_squish_mapping.tsv
+++ /dev/null
@@ -1 +0,0 @@
-"squishversion" "qtversion" "mkspec" "path"
diff --git a/tests/system/suite_debugger/tst_qml_locals/test.py b/tests/system/suite_debugger/tst_qml_locals/test.py
index fb6d45c649..8431558d02 100644
--- a/tests/system/suite_debugger/tst_qml_locals/test.py
+++ b/tests/system/suite_debugger/tst_qml_locals/test.py
@@ -61,7 +61,7 @@ def main():
"type='QCheckBox' unnamed='1' visible='1'}")
switchViewTo(ViewConstants.EDIT)
if platform.system() in ('Microsoft', 'Windows'):
- qmake = getQtInformationForQmlProject()[3]
+ qmake = getQtInformationForQmlProject()
if qmake == None:
earlyExit("Could not figure out which qmake is used.")
return
diff --git a/tests/system/suite_qtquick/tst_qtquick_creation/test.py b/tests/system/suite_qtquick/tst_qtquick_creation/test.py
index 0487240ecb..0289d27783 100644
--- a/tests/system/suite_qtquick/tst_qtquick_creation/test.py
+++ b/tests/system/suite_qtquick/tst_qtquick_creation/test.py
@@ -51,7 +51,6 @@ def main():
additionalText = ' Controls '
test.log("Building project Qt Quick%sApplication (%s)"
% (additionalText, Targets.getStringForTarget(targ)))
- result = modifyRunSettingsForHookInto(projectName, len(checkedTargets), 11223)
invokeMenuItem("Build", "Build All")
waitForCompile()
if not checkCompile():
@@ -59,20 +58,7 @@ def main():
else:
checkLastBuild()
test.log("Running project (includes build)")
- if result:
- result = addExecutableAsAttachableAUT(projectName, 11223)
- allowAppThroughWinFW(workingDir, projectName)
- if result:
- function = "subprocessFunctionQuick2"
- result = runAndCloseApp(True, projectName, 11223, function,
- SubprocessType.QT_QUICK_APPLICATION, quickVersion=quick)
- else:
- result = runAndCloseApp(sType=SubprocessType.QT_QUICK_APPLICATION)
- removeExecutableAsAttachableAUT(projectName, 11223)
- deleteAppFromWinFW(workingDir, projectName)
- else:
- result = runAndCloseApp()
- if result == None:
+ if runAndCloseApp() == None:
checkCompile()
else:
appOutput = logApplicationOutput()
@@ -81,13 +67,3 @@ def main():
invokeMenuItem("File", "Close All Projects and Editors")
invokeMenuItem("File", "Exit")
-
-def subprocessFunctionGenericQuick(quickVersion):
- helloWorldText = waitForObject("{container={type='QtQuick%dApplicationViewer' visible='1' "
- "unnamed='1'} enabled='true' text='Hello World' type='Text' "
- "unnamed='1' visible='true'}" % quickVersion)
- test.log("Clicking 'Hello World' Text to close QtQuick%dApplicationViewer" % quickVersion)
- mouseClick(helloWorldText, 5, 5, 0, Qt.LeftButton)
-
-def subprocessFunctionQuick2():
- subprocessFunctionGenericQuick(2)
diff --git a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py
index 24a43f18e7..8ae189d5ed 100644
--- a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py
+++ b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py
@@ -34,23 +34,8 @@ def main():
for qtVersion in available:
# using a temporary directory won't mess up a potentially existing
workingDir = tempDir()
- projectName = createNewQtQuickUI(workingDir, qtVersion)
- quick = "2.6"
- qmlViewer = modifyRunSettingsForHookIntoQtQuickUI(1, 0, workingDir, projectName, 11223, quick)
- if qmlViewer!=None:
- qmlViewerPath = os.path.dirname(qmlViewer)
- qmlViewer = os.path.basename(qmlViewer)
- result = addExecutableAsAttachableAUT(qmlViewer, 11223)
- allowAppThroughWinFW(qmlViewerPath, qmlViewer, None)
- if result:
- result = runAndCloseApp(True, qmlViewer, 11223, sType=SubprocessType.QT_QUICK_UI, quickVersion=quick)
- else:
- result = runAndCloseApp(sType=SubprocessType.QT_QUICK_UI)
- removeExecutableAsAttachableAUT(qmlViewer, 11223)
- deleteAppFromWinFW(qmlViewerPath, qmlViewer)
- else:
- result = runAndCloseApp(sType=SubprocessType.QT_QUICK_UI)
- if result == None:
+ createNewQtQuickUI(workingDir, qtVersion)
+ if runAndCloseApp(True) == None:
checkCompile()
else:
appOutput = logApplicationOutput()