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
This commit is contained in:
Eike Ziller
2018-05-14 09:44:43 +02:00
17 changed files with 97 additions and 169 deletions

View File

@@ -193,6 +193,13 @@ for(dir, QTC_PLUGIN_DIRS) {
INCLUDEPATH += $$dir INCLUDEPATH += $$dir
} }
QTC_LIB_DIRS_FROM_ENVIRONMENT = $$(QTC_LIB_DIRS)
QTC_LIB_DIRS += $$split(QTC_LIB_DIRS_FROM_ENVIRONMENT, $$QMAKE_DIRLIST_SEP)
QTC_LIB_DIRS += $$IDE_SOURCE_TREE/src/libs
for(dir, QTC_LIB_DIRS) {
INCLUDEPATH += $$dir
}
CONFIG += \ CONFIG += \
depend_includepath \ depend_includepath \
no_include_pwd no_include_pwd
@@ -276,7 +283,16 @@ for(ever) {
break() break()
done_libs += $$QTC_LIB_DEPENDS done_libs += $$QTC_LIB_DEPENDS
for(dep, QTC_LIB_DEPENDS) { for(dep, QTC_LIB_DEPENDS) {
include($$PWD/src/libs/$$dep/$${dep}_dependencies.pri) dependencies_file =
for(dir, QTC_LIB_DIRS) {
exists($$dir/$$dep/$${dep}_dependencies.pri) {
dependencies_file = $$dir/$$dep/$${dep}_dependencies.pri
break()
}
}
isEmpty(dependencies_file): \
error("Library dependency $$dep not found")
include($$dependencies_file)
LIBS += -l$$qtLibraryName($$QTC_LIB_NAME) LIBS += -l$$qtLibraryName($$QTC_LIB_NAME)
} }
QTC_LIB_DEPENDS = $$unique(QTC_LIB_DEPENDS) QTC_LIB_DEPENDS = $$unique(QTC_LIB_DEPENDS)

View File

@@ -31,6 +31,7 @@
#include <utils/stringutils.h> #include <utils/stringutils.h>
#include <QAction> #include <QAction>
#include <QTimer>
namespace Core { namespace Core {
@@ -104,8 +105,11 @@ void CommandLocator::accept(LocatorFilterEntry entry,
const int index = entry.internalData.toInt(); const int index = entry.internalData.toInt();
QTC_ASSERT(index >= 0 && index < d->commands.size(), return); QTC_ASSERT(index >= 0 && index < d->commands.size(), return);
QAction *action = d->commands.at(index)->action(); QAction *action = d->commands.at(index)->action();
QTC_ASSERT(action->isEnabled(), return); // avoid nested stack trace and blocking locator by delayed triggering
action->trigger(); QTimer::singleShot(0, action, [action] {
if (action->isEnabled())
action->trigger();
});
} }
void CommandLocator::refresh(QFutureInterface<void> &) void CommandLocator::refresh(QFutureInterface<void> &)

View File

@@ -36,6 +36,7 @@
#include <QMenuBar> #include <QMenuBar>
#include <QPointer> #include <QPointer>
#include <QRegularExpression> #include <QRegularExpression>
#include <QTimer>
using namespace Core::Internal; using namespace Core::Internal;
using namespace Core; using namespace Core;
@@ -77,8 +78,12 @@ void MenuBarFilter::accept(LocatorFilterEntry selection, QString *newText,
Q_UNUSED(newText); Q_UNUSED(newText);
Q_UNUSED(selectionStart); Q_UNUSED(selectionStart);
Q_UNUSED(selectionLength); Q_UNUSED(selectionLength);
if (auto action = selection.internalData.value<QPointer<QAction>>()) if (auto action = selection.internalData.value<QPointer<QAction>>()) {
action->trigger(); QTimer::singleShot(0, action, [action] {
if (action->isEnabled())
action->trigger();
});
}
} }
void MenuBarFilter::refresh(QFutureInterface<void> &future) void MenuBarFilter::refresh(QFutureInterface<void> &future)

View File

@@ -53,6 +53,11 @@ QStringList CompilerOptionsBuilder::build(CppTools::ProjectFile::Kind fileKind,
{ {
m_options.clear(); m_options.clear();
if (fileKind == ProjectFile::CHeader || fileKind == ProjectFile::CSource) {
QTC_ASSERT(m_projectPart.languageVersion <= ProjectPart::LatestCVersion,
return QStringList(););
}
addWordWidth(); addWordWidth();
addTargetTriple(); addTargetTriple();
addExtraCodeModelFlags(); addExtraCodeModelFlags();
@@ -118,7 +123,8 @@ void CompilerOptionsBuilder::addExtraCodeModelFlags()
void CompilerOptionsBuilder::enableExceptions() void CompilerOptionsBuilder::enableExceptions()
{ {
add(QLatin1String("-fcxx-exceptions")); if (m_projectPart.languageVersion > ProjectPart::LatestCVersion)
add(QLatin1String("-fcxx-exceptions"));
add(QLatin1String("-fexceptions")); add(QLatin1String("-fexceptions"));
} }
@@ -286,6 +292,7 @@ void CompilerOptionsBuilder::addOptionsForLanguage(bool checkForBorlandExtension
QStringList opts; QStringList opts;
const ProjectPart::LanguageExtensions languageExtensions = m_projectPart.languageExtensions; const ProjectPart::LanguageExtensions languageExtensions = m_projectPart.languageExtensions;
const bool gnuExtensions = languageExtensions & ProjectPart::GnuExtensions; const bool gnuExtensions = languageExtensions & ProjectPart::GnuExtensions;
switch (m_projectPart.languageVersion) { switch (m_projectPart.languageVersion) {
case ProjectPart::C89: case ProjectPart::C89:
opts << (gnuExtensions ? QLatin1String("-std=gnu89") : QLatin1String("-std=c89")); opts << (gnuExtensions ? QLatin1String("-std=gnu89") : QLatin1String("-std=c89"));
@@ -471,8 +478,7 @@ QString CompilerOptionsBuilder::includeOption() const
bool CompilerOptionsBuilder::excludeDefineDirective(const ProjectExplorer::Macro &macro) const bool CompilerOptionsBuilder::excludeDefineDirective(const ProjectExplorer::Macro &macro) const
{ {
// This is a quick fix for QTCREATORBUG-11501. // TODO: Remove in QtCreator 4.7
// TODO: do a proper fix, see QTCREATORBUG-11709.
if (macro.key == "__cplusplus") if (macro.key == "__cplusplus")
return true; return true;

View File

@@ -1188,7 +1188,8 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
if (!kit) if (!kit)
kit = guessKitFromAbis(Abi::abisOfBinary(FileName::fromString(executable))); kit = guessKitFromAbis(Abi::abisOfBinary(FileName::fromString(executable)));
auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE); IDevice::ConstPtr device = DeviceKitInformation::device(kit);
auto runControl = new RunControl(device, ProjectExplorer::Constants::DEBUG_RUN_MODE);
auto debugger = new DebuggerRunTool(runControl, kit); auto debugger = new DebuggerRunTool(runControl, kit);
debugger->setInferiorExecutable(executable); debugger->setInferiorExecutable(executable);
if (pid) { if (pid) {
@@ -1953,7 +1954,8 @@ void DebuggerPluginPrivate::attachCore()
setConfigValue("LastExternalStartScript", dlg.overrideStartScript()); setConfigValue("LastExternalStartScript", dlg.overrideStartScript());
setConfigValue("LastForceLocalCoreFile", dlg.forcesLocalCoreFile()); setConfigValue("LastForceLocalCoreFile", dlg.forcesLocalCoreFile());
auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE); IDevice::ConstPtr device = DeviceKitInformation::device(dlg.kit());
auto runControl = new RunControl(device, ProjectExplorer::Constants::DEBUG_RUN_MODE);
auto debugger = new DebuggerRunTool(runControl, dlg.kit()); auto debugger = new DebuggerRunTool(runControl, dlg.kit());
debugger->setInferiorExecutable(dlg.localExecutableFile()); debugger->setInferiorExecutable(dlg.localExecutableFile());
debugger->setCoreFileName(dlg.localCoreFile()); debugger->setCoreFileName(dlg.localCoreFile());
@@ -1980,7 +1982,8 @@ void DebuggerPluginPrivate::startRemoteCdbSession()
return; return;
setConfigValue(connectionKey, dlg.connection()); setConfigValue(connectionKey, dlg.connection());
auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE); IDevice::ConstPtr device = DeviceKitInformation::device(kit);
auto runControl = new RunControl(device, ProjectExplorer::Constants::DEBUG_RUN_MODE);
auto debugger = new DebuggerRunTool(runControl, kit); auto debugger = new DebuggerRunTool(runControl, kit);
debugger->setStartMode(AttachToRemoteServer); debugger->setStartMode(AttachToRemoteServer);
debugger->setCloseMode(KillAtClose); debugger->setCloseMode(KillAtClose);
@@ -2038,7 +2041,7 @@ void DebuggerPluginPrivate::attachToRunningApplication()
if (device->type() == PE::DESKTOP_DEVICE_TYPE) { if (device->type() == PE::DESKTOP_DEVICE_TYPE) {
attachToRunningProcess(kit, process, false); attachToRunningProcess(kit, process, false);
} else { } else {
auto runControl = new RunControl(nullptr, ProjectExplorer::Constants::DEBUG_RUN_MODE); auto runControl = new RunControl(device, ProjectExplorer::Constants::DEBUG_RUN_MODE);
auto debugger = new RemoteAttachRunner(runControl, kit, process.pid); auto debugger = new RemoteAttachRunner(runControl, kit, process.pid);
debugger->startRunControl(); debugger->startRunControl();
} }

View File

@@ -133,15 +133,27 @@ ToolChain::CompilerFlags AbstractMsvcToolChain::compilerFlags(const QStringList
if (cxxflags.contains(QLatin1String("/Za"))) if (cxxflags.contains(QLatin1String("/Za")))
flags &= ~MicrosoftExtensions; flags &= ~MicrosoftExtensions;
bool cLanguage = (language() == ProjectExplorer::Constants::C_LANGUAGE_ID);
switch (m_abi.osFlavor()) { switch (m_abi.osFlavor()) {
case Abi::WindowsMsvc2010Flavor: case Abi::WindowsMsvc2010Flavor:
case Abi::WindowsMsvc2012Flavor: flags |= StandardCxx11; case Abi::WindowsMsvc2012Flavor:
if (cLanguage)
flags |= StandardC99;
else
flags |= StandardCxx11;
break; break;
case Abi::WindowsMsvc2013Flavor: case Abi::WindowsMsvc2013Flavor:
case Abi::WindowsMsvc2015Flavor: flags |= StandardCxx14; case Abi::WindowsMsvc2015Flavor:
if (cLanguage)
flags |= StandardC99;
else
flags |= StandardCxx14;
break; break;
case Abi::WindowsMsvc2017Flavor: case Abi::WindowsMsvc2017Flavor:
if (cxxflags.contains("/std:c++17") || cxxflags.contains("/std:c++latest")) if (cLanguage)
flags |= StandardC11;
else if (cxxflags.contains("/std:c++17") || cxxflags.contains("/std:c++latest"))
flags |= StandardCxx17; flags |= StandardCxx17;
else else
flags |= StandardCxx14; flags |= StandardCxx14;

View File

@@ -921,6 +921,12 @@ RunControl::RunControl(RunConfiguration *runConfiguration, Core::Id mode) :
#endif #endif
} }
RunControl::RunControl(const IDevice::ConstPtr &device, Core::Id mode)
: RunControl(nullptr, mode)
{
d->device = device;
}
RunControl::~RunControl() RunControl::~RunControl()
{ {
#ifdef WITH_JOURNALD #ifdef WITH_JOURNALD

View File

@@ -461,6 +461,7 @@ class PROJECTEXPLORER_EXPORT RunControl : public QObject
public: public:
RunControl(RunConfiguration *runConfiguration, Core::Id mode); RunControl(RunConfiguration *runConfiguration, Core::Id mode);
RunControl(const IDevice::ConstPtr &device, Core::Id mode);
~RunControl() override; ~RunControl() override;
void initiateStart(); void initiateStart();

View File

@@ -76,8 +76,8 @@ Attention! If any of these prerequisites cannot be satisfied the tests will like
Prerequisites - debugging and analyzing Prerequisites - debugging and analyzing
----------------------------------------- -----------------------------------------
In some tests, Creator needs to read data from an application it started. In tst_simple_debug from suite_debbugger, Creator needs to read data from an application it
On Windows, those have the following prerequisites: started. On Windows, this has the following prerequisites:
Either: Either:
* have no firewall at all enabled (sure that's a bad idea) * have no firewall at all enabled (sure that's a bad idea)
Or: Or:

View File

@@ -118,11 +118,6 @@ class ViewConstants:
return None return None
return toolTip % (viewTab + 1) return toolTip % (viewTab + 1)
class QtInformation:
QT_VERSION = 0
QT_BINPATH = 1
QT_LIBPATH = 2
class LibType: class LibType:
SHARED = 0 SHARED = 0
STATIC = 1 STATIC = 1

View File

@@ -157,64 +157,13 @@ def getQtInformationForBuildSettings(kitCount, alreadyOnProjectsBuildSettings=Fa
qmakeCallLabel = waitForObject("{text?='<b>qmake:</b> qmake*' type='QLabel' unnamed='1' visible='1' " qmakeCallLabel = waitForObject("{text?='<b>qmake:</b> qmake*' type='QLabel' unnamed='1' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}") "window=':Qt Creator_Core::Internal::MainWindow'}")
mkspec = __getMkspecFromQMakeCall__(str(qmakeCallLabel.text)) qtVersion = getQtInformationByQMakeCall(qtDir)
qtVersion = getQtInformationByQMakeCall(qtDir, QtInformation.QT_VERSION)
qtLibPath = getQtInformationByQMakeCall(qtDir, QtInformation.QT_LIBPATH)
qtBinPath = getQtInformationByQMakeCall(qtDir, QtInformation.QT_BINPATH)
if afterSwitchTo: if afterSwitchTo:
if ViewConstants.FIRST_AVAILABLE <= afterSwitchTo <= ViewConstants.LAST_AVAILABLE: if ViewConstants.FIRST_AVAILABLE <= afterSwitchTo <= ViewConstants.LAST_AVAILABLE:
switchViewTo(afterSwitchTo) switchViewTo(afterSwitchTo)
else: else:
test.warning("Don't know where you trying to switch to (%s)" % afterSwitchTo) test.warning("Don't know where you trying to switch to (%s)" % afterSwitchTo)
return qtVersion, mkspec, qtBinPath, qtLibPath return qtVersion
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
def __getTargetFromToolTip__(toolTip): def __getTargetFromToolTip__(toolTip):
if toolTip == None or not isinstance(toolTip, (str, unicode)): if toolTip == None or not isinstance(toolTip, (str, unicode)):
@@ -240,20 +189,10 @@ def getExecutableAndTargetFromToolTip(toolTip):
return None, target return None, target
return exe.group(1).strip(), target return exe.group(1).strip(), target
def __getMkspecFromQMakeCall__(qmakeCall): # this function queries the version number from qmake
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
# param qtDir set this to a path that holds a valid Qt # 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 # 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") qmake = os.path.join(qtDir, "bin", "qmake")
if platform.system() in ('Microsoft', 'Windows'): if platform.system() in ('Microsoft', 'Windows'):
qmake += ".exe" qmake += ".exe"
@@ -261,17 +200,7 @@ def getQtInformationByQMakeCall(qtDir, which):
test.fatal("Given Qt directory does not exist or does not contain bin/qmake.", test.fatal("Given Qt directory does not exist or does not contain bin/qmake.",
"Constructed path: '%s'" % qmake) "Constructed path: '%s'" % qmake)
return None return None
query = "" return getOutputFromCmdline([qmake, "-query", "QT_VERSION"]).strip()
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()
def invokeContextMenuOnProject(projectName, menuItem): def invokeContextMenuOnProject(projectName, menuItem):
try: try:

View File

@@ -114,6 +114,7 @@ def selectFromLocator(filter, itemName = None):
# clicking the wanted item # clicking the wanted item
# if you replace this by pressing ENTER, be sure that something is selected # if you replace this by pressing ENTER, be sure that something is selected
# otherwise you will run into unwanted behavior # otherwise you will run into unwanted behavior
snooze(1)
wantedItem = waitForObjectItem("{type='QTreeView' unnamed='1' visible='1'}", itemName) wantedItem = waitForObjectItem("{type='QTreeView' unnamed='1' visible='1'}", itemName)
doubleClick(wantedItem, 5, 5, 0, Qt.LeftButton) doubleClick(wantedItem, 5, 5, 0, Qt.LeftButton)
@@ -176,21 +177,10 @@ def invokeMenuItem(menu, item, *subItems):
waitForObject(":Qt Creator.QtCreator.MenuBar_QMenuBar", 2000) waitForObject(":Qt Creator.QtCreator.MenuBar_QMenuBar", 2000)
except: except:
nativeMouseClick(waitForObject(":Qt Creator_Core::Internal::MainWindow", 1000), 20, 20, 0, Qt.LeftButton) 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 # Use Locator for menu items which wouldn't work on macOS
if platform.system() == "Darwin": if menu == "Tools" and item == "Options..." or menu == "File" and item == "Exit":
if menu == "Tools" and item == "Options...": selectFromLocator("t %s" % item, item)
#nativeType("<Command+,>") return
# 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
menuObject = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar", menu) menuObject = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar", menu)
snooze(1) snooze(1)
waitFor("menuObject.visible", 1000) waitFor("menuObject.visible", 1000)

View File

@@ -97,13 +97,6 @@ def performDebugging(projectName, checkedTargets):
invokeMenuItem("Build", "Rebuild All") invokeMenuItem("Build", "Rebuild All")
waitForCompile() waitForCompile()
isMsvc = isMsvcConfig(len(checkedTargets), kit) 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")) clickButton(waitForObject(":*Qt Creator.Start Debugging_Core::Internal::FancyToolButton"))
handleDebuggerWarnings(config, isMsvc) handleDebuggerWarnings(config, isMsvc)
waitForObject(":Qt Creator.DebugModeWidget_QSplitter") waitForObject(":Qt Creator.DebugModeWidget_QSplitter")
@@ -118,5 +111,3 @@ def performDebugging(projectName, checkedTargets):
clickButton(waitForObject(":*Qt Creator.Continue_Core::Internal::FancyToolButton")) clickButton(waitForObject(":*Qt Creator.Continue_Core::Internal::FancyToolButton"))
__handleAppOutputWaitForDebuggerFinish__() __handleAppOutputWaitForDebuggerFinish__()
removeOldBreakpoints() removeOldBreakpoints()
if platform.system() in ('Microsoft' 'Windows'):
deleteAppFromWinFW(buildDir, projectName, None)

View File

@@ -60,14 +60,6 @@ def main():
ensureChecked("{container=':Qt Creator.scrollArea_QScrollArea' text='Enable QML' " ensureChecked("{container=':Qt Creator.scrollArea_QScrollArea' text='Enable QML' "
"type='QCheckBox' unnamed='1' visible='1'}") "type='QCheckBox' unnamed='1' visible='1'}")
switchViewTo(ViewConstants.EDIT) 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) clickButton(fancyDebugButton)
locAndExprTV = waitForObject(":Locals and Expressions_Debugger::Internal::WatchTreeView") locAndExprTV = waitForObject(":Locals and Expressions_Debugger::Internal::WatchTreeView")
# Locals and Expressions populates treeview only on demand - so the tree must be expanded # Locals and Expressions populates treeview only on demand - so the tree must be expanded
@@ -96,8 +88,6 @@ def main():
subItem = items subItem = items
checkForExpectedValues(subItem, current[2], current[3]) checkForExpectedValues(subItem, current[2], current[3])
clickButton(waitForObject(':Debugger Toolbar.Exit Debugger_QToolButton', 5000)) clickButton(waitForObject(':Debugger Toolbar.Exit Debugger_QToolButton', 5000))
if platform.system() in ('Microsoft', 'Windows'):
deleteAppFromWinFW(qmlScenePath, qmlScene)
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")
def __unfoldTree__(): def __unfoldTree__():

View File

@@ -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 # 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) # of differences between MSVC's and MinGW's Makefile (so clean before switching kits)
invokeMenuItem('Build', 'Clean Project "%s"' % projectName) 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) test.log("Selected kit using Qt %s" % qtVersion)
# explicitly build before start debugging for adding the executable as allowed program to WinFW # explicitly build before start debugging for adding the executable as allowed program to WinFW
invokeMenuItem("Build", "Rebuild All") invokeMenuItem("Build", "Rebuild All")
@@ -75,13 +75,6 @@ def performTest(workingDir, projectName, targetCount, availableConfigs):
if not checkCompile(): if not checkCompile():
test.fatal("Compile had errors... Skipping current build config") test.fatal("Compile had errors... Skipping current build config")
continue 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) switchViewTo(ViewConstants.DEBUG)
selectFromCombo(":Analyzer Toolbar.AnalyzerManagerToolBox_QComboBox", "QML Profiler") selectFromCombo(":Analyzer Toolbar.AnalyzerManagerToolBox_QComboBox", "QML Profiler")
recordButton = waitForObject("{container=':DebugModeWidget.Toolbar_QDockWidget' " recordButton = waitForObject("{container=':DebugModeWidget.Toolbar_QDockWidget' "
@@ -131,8 +124,6 @@ def performTest(workingDir, projectName, targetCount, availableConfigs):
elif str(model.index(row, colCalls).data()) == "2": elif str(model.index(row, colCalls).data()) == "2":
test.compare(model.index(row, colMedian).data(), model.index(row, colLongest).data(), test.compare(model.index(row, colMedian).data(), model.index(row, colLongest).data(),
"For two calls, median and longest time must be the same.") "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 progressBarWait(15000, False) # wait for "Build" progressbar to disappear
clickButton(waitForObject(":Analyzer Toolbar.Clear_QToolButton")) clickButton(waitForObject(":Analyzer Toolbar.Clear_QToolButton"))
test.verify(waitFor("model.rowCount() == 0", 3000), "Analyzer results cleared.") test.verify(waitFor("model.rowCount() == 0", 3000), "Analyzer results cleared.")

View File

@@ -50,21 +50,10 @@ def main():
overrideStartApplication() overrideStartApplication()
startApplication("qtcreator" + SettingsPath) startApplication("qtcreator" + SettingsPath)
try: try:
if platform.system() == 'Darwin': # Use Locator for menu items which wouldn't work on macOS
try: exitCommand = testData.field(lang, "Exit")
fileMenu = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar", selectFromLocator("t %s" % exitCommand.rstrip("(X)"), exitCommand)
testData.field(lang, "File")) test.passes("Creator was running in %s translation." % languageName)
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)
except: except:
test.fail("Creator seems to be missing %s translation" % languageName) test.fail("Creator seems to be missing %s translation" % languageName)
sendEvent("QCloseEvent", ":Qt Creator_Core::Internal::MainWindow") sendEvent("QCloseEvent", ":Qt Creator_Core::Internal::MainWindow")

View File

@@ -1,12 +1,12 @@
"language" "File" "Exit" "ISO" "language" "Exit" "ISO"
"Czech (CzechRepublic)" "Soubor" "Ukončit" "cs_CZ" "Czech (CzechRepublic)" "Ukončit" "cs_CZ"
"Danish (Denmark)" "Fil" "Afslut" "da_DK" "Danish (Denmark)" "Afslut" "da_DK"
"German (Germany)" "Datei" "Beenden" "de_DE" "German (Germany)" "Beenden" "de_DE"
"French (France)" "Fichier" "Quitter" "fr_FR" "French (France)" "Quitter" "fr_FR"
"Japanese (Japan)" "ファイル(F)" "終了(X)" "ja_JP" "Japanese (Japan)" "終了(X)" "ja_JP"
"Polish (Poland)" "Plik" "Zakończ" "pl_PL" "Polish (Poland)" "Zakończ" "pl_PL"
"Russian (%1)" "Файл" "Выход" "ru_RU" "Russian (%1)" "Выход" "ru_RU"
"Slovenian (Slovenia)" "Datoteka" "Končaj" "sl_SL" "Slovenian (Slovenia)" "Končaj" "sl_SL"
"Ukrainian (Ukraine)" "Файл" "Вийти" "uk_UA" "Ukrainian (Ukraine)" "Вийти" "uk_UA"
"Chinese (China)" "文件(F)" "退出(X)" "zh_CN" "Chinese (China)" "退出(X)" "zh_CN"
"Chinese (Taiwan)" "檔案(F)" "離開(X)" "zh_TW" "Chinese (Taiwan)" "離開(X)" "zh_TW"
1 language File Exit ISO
2 Czech (CzechRepublic) Soubor Ukončit cs_CZ
3 Danish (Denmark) Fil Afslut da_DK
4 German (Germany) Datei Beenden de_DE
5 French (France) Fichier Quitter fr_FR
6 Japanese (Japan) ファイル(F) 終了(X) ja_JP
7 Polish (Poland) Plik Zakończ pl_PL
8 Russian (%1) Файл Выход ru_RU
9 Slovenian (Slovenia) Datoteka Končaj sl_SL
10 Ukrainian (Ukraine) Файл Вийти uk_UA
11 Chinese (China) 文件(F) 退出(X) zh_CN
12 Chinese (Taiwan) 檔案(F) 離開(X) zh_TW