Merge remote-tracking branch 'origin/4.4'

Change-Id: I53a31b3463b2bd8efffb1c00e5d172854d8ff5e5
This commit is contained in:
Eike Ziller
2017-09-08 13:06:07 +02:00
17 changed files with 102 additions and 31 deletions

View File

@@ -47,5 +47,7 @@
integration integration
\li \l{http://doc.qt.io/QtForDeviceCreation/index.html}{Developing for \li \l{http://doc.qt.io/QtForDeviceCreation/index.html}{Developing for
embedded devices} embedded devices}
\li \l{http://doc.qt.io/qtcreator/creator-overview-qtasam.html}
{Qt Application Manager} integration
\endlist \endlist
*/ */

View File

@@ -85,4 +85,16 @@
\endlist \endlist
\section1 Related Topics
\list
\li \l{http://doc.qt.io/qtcreator/creator-overview-qtasam.html}
{Qt Application Manager}
You can use the experimental Qt Application Manager plugin
(commercial only) to deploy, run, and debug applications on the
local Linux PC, remote generic SSH Linux targets, or
\l{Embedded Devices}{embedded devices}.
\endlist
*/ */

View File

@@ -55,7 +55,7 @@ namespace Internal {
static const char * const qMakeVariables[] = { static const char * const qMakeVariables[] = {
"QT_INSTALL_LIBS", "QT_INSTALL_LIBS",
"QT_INSTALL_PLUGINS", "QT_INSTALL_PLUGINS",
"QT_INSTALL_IMPORTS" "QT_INSTALL_QML"
}; };
static QStringList qtSoPaths(QtSupport::BaseQtVersion *qtVersion) static QStringList qtSoPaths(QtSupport::BaseQtVersion *qtVersion)

View File

@@ -161,7 +161,8 @@ static void prependTargetTripleIfNotIncludedAndNotEmpty(QStringList *arguments,
} }
// Removes (1) inputFile (2) -o <somePath>. // Removes (1) inputFile (2) -o <somePath>.
QStringList inputAndOutputArgumentsRemoved(const QString &inputFile, const QStringList &arguments) QStringList inputAndOutputArgumentsRemoved(const QString &inputFile, const QStringList &arguments,
bool isMsvc)
{ {
QStringList newArguments; QStringList newArguments;
@@ -173,6 +174,9 @@ QStringList inputAndOutputArgumentsRemoved(const QString &inputFile, const QStri
} else if (argument == QLatin1String("-o")) { } else if (argument == QLatin1String("-o")) {
skip = true; skip = true;
continue; continue;
} else if (isMsvc && argument == QLatin1String("-target")) {
skip = true;
continue;
} else if (QDir::fromNativeSeparators(argument) == inputFile) { } else if (QDir::fromNativeSeparators(argument) == inputFile) {
continue; // TODO: Let it in? continue; // TODO: Let it in?
} }
@@ -233,11 +237,23 @@ public:
ClangStaticAnalyzerOptionsBuilder(const CppTools::ProjectPart &projectPart) ClangStaticAnalyzerOptionsBuilder(const CppTools::ProjectPart &projectPart)
: CompilerOptionsBuilder(projectPart) : CompilerOptionsBuilder(projectPart)
, m_isMsvcToolchain(m_projectPart.toolchainType == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID) , m_isMsvcToolchain(m_projectPart.toolchainType
== ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID)
, m_isMinGWToolchain(m_projectPart.toolchainType
== ProjectExplorer::Constants::MINGW_TOOLCHAIN_TYPEID)
{ {
} }
public: public:
bool excludeHeaderPath(const QString &headerPath) const override
{
if (CompilerOptionsBuilder::excludeHeaderPath(headerPath))
return true;
if (m_isMinGWToolchain && headerPath.contains(m_projectPart.toolChainTargetTriple))
return true;
return false;
}
void undefineClangVersionMacrosForMsvc() void undefineClangVersionMacrosForMsvc()
{ {
if (m_projectPart.toolchainType == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID) { if (m_projectPart.toolchainType == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID) {
@@ -260,7 +276,7 @@ private:
// For MSVC toolchains we use clang-cl.exe, so there is nothing to do here since // For MSVC toolchains we use clang-cl.exe, so there is nothing to do here since
// 1) clang-cl.exe does not understand the "-triple" option // 1) clang-cl.exe does not understand the "-triple" option
// 2) clang-cl.exe already hardcodes the right triple value (even if built with mingw) // 2) clang-cl.exe already hardcodes the right triple value (even if built with mingw)
if (m_projectPart.toolchainType != ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID) if (!m_isMsvcToolchain)
CompilerOptionsBuilder::addTargetTriple(); CompilerOptionsBuilder::addTargetTriple();
} }
@@ -317,6 +333,7 @@ private:
private: private:
bool m_isMsvcToolchain; bool m_isMsvcToolchain;
bool m_isMinGWToolchain;
}; };
static QStringList createMsCompatibilityVersionOption(const ProjectPart &projectPart) static QStringList createMsCompatibilityVersionOption(const ProjectPart &projectPart)
@@ -364,9 +381,12 @@ static QStringList tweakedArguments(const ProjectPart &projectPart,
const QStringList &arguments, const QStringList &arguments,
const QString &targetTriple) const QString &targetTriple)
{ {
QStringList newArguments = inputAndOutputArgumentsRemoved(filePath, arguments); const bool isMsvc = projectPart.toolchainType
== ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID;
QStringList newArguments = inputAndOutputArgumentsRemoved(filePath, arguments, isMsvc);
prependWordWidthArgumentIfNotIncluded(&newArguments, projectPart.toolChainWordWidth); prependWordWidthArgumentIfNotIncluded(&newArguments, projectPart.toolChainWordWidth);
prependTargetTripleIfNotIncludedAndNotEmpty(&newArguments, targetTriple); if (!isMsvc)
prependTargetTripleIfNotIncludedAndNotEmpty(&newArguments, targetTriple);
newArguments.append(createHeaderPathsOptionsForClangOnMac(projectPart)); newArguments.append(createHeaderPathsOptionsForClangOnMac(projectPart));
newArguments.append(createMsCompatibilityVersionOption(projectPart)); newArguments.append(createMsCompatibilityVersionOption(projectPart));
newArguments.append(createOptionsToUndefineClangVersionMacrosForMsvc(projectPart)); newArguments.append(createOptionsToUndefineClangVersionMacrosForMsvc(projectPart));

View File

@@ -75,6 +75,13 @@ void ClangStaticAnalyzerUnitTests::testProject()
{ {
QFETCH(QString, projectFilePath); QFETCH(QString, projectFilePath);
QFETCH(int, expectedDiagCount); QFETCH(int, expectedDiagCount);
if (projectFilePath.contains("mingw")) {
const ToolChain * const toolchain
= ToolChainKitInformation::toolChain(KitManager::kits().first(),
Constants::CXX_LANGUAGE_ID);
if (toolchain->typeId() != ProjectExplorer::Constants::MINGW_TOOLCHAIN_TYPEID)
QSKIP("This test is mingw specific, does not run for other toolchais");
}
CppTools::Tests::ProjectOpenerAndCloser projectManager; CppTools::Tests::ProjectOpenerAndCloser projectManager;
const CppTools::ProjectInfo projectInfo = projectManager.open(projectFilePath, true); const CppTools::ProjectInfo projectInfo = projectManager.open(projectFilePath, true);
@@ -107,6 +114,9 @@ void ClangStaticAnalyzerUnitTests::testProject_data()
addTestRow("qt-essential-includes/qt-essential-includes.qbs", 0); addTestRow("qt-essential-includes/qt-essential-includes.qbs", 0);
addTestRow("qt-essential-includes/qt-essential-includes.pro", 0); addTestRow("qt-essential-includes/qt-essential-includes.pro", 0);
addTestRow("mingw-includes/mingw-includes.qbs", 0);
addTestRow("mingw-includes/mingw-includes.pro", 0);
} }
void ClangStaticAnalyzerUnitTests::addTestRow(const QByteArray &relativeFilePath, void ClangStaticAnalyzerUnitTests::addTestRow(const QByteArray &relativeFilePath,

View File

@@ -0,0 +1,7 @@
#include <cstddef>
#include "intrin.h"
int main(int argc, char *argv[])
{
return 0;
}

View File

@@ -0,0 +1,3 @@
CONFIG -= QT
SOURCES += main.cpp

View File

@@ -0,0 +1,5 @@
import qbs
CppApplication {
files: ["main.cpp"]
}

View File

@@ -44,6 +44,7 @@
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h> #include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/featureprovider.h> #include <coreplugin/featureprovider.h>
#include <coreplugin/helpmanager.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/idocument.h> #include <coreplugin/idocument.h>
#include <coreplugin/fileiconprovider.h> #include <coreplugin/fileiconprovider.h>
@@ -91,6 +92,7 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
const Core::Context projectContext(::QbsProjectManager::Constants::PROJECT_ID); const Core::Context projectContext(::QbsProjectManager::Constants::PROJECT_ID);
Core::FileIconProvider::registerIconOverlayForSuffix(ProjectExplorer::Constants::FILEOVERLAY_QT, "qbs"); Core::FileIconProvider::registerIconOverlayForSuffix(ProjectExplorer::Constants::FILEOVERLAY_QT, "qbs");
Core::HelpManager::registerDocumentation({Core::ICore::documentationPath() + "/qbs.qch"});
ProjectManager::registerProjectType<QbsProject>(QmlJSTools::Constants::QBS_MIMETYPE); ProjectManager::registerProjectType<QbsProject>(QmlJSTools::Constants::QBS_MIMETYPE);
KitManager::registerKitInformation(new QbsKitInformation); KitManager::registerKitInformation(new QbsKitInformation);

View File

@@ -79,6 +79,8 @@ private:
arguments.append(Utils::QtcProcess::splitArgs(r.commandLineArguments)); arguments.append(Utils::QtcProcess::splitArgs(r.commandLineArguments));
r.commandLineArguments = Utils::QtcProcess::joinArgs(arguments); r.commandLineArguments = Utils::QtcProcess::joinArgs(arguments);
setRunnable(r);
SimpleTargetRunner::start(); SimpleTargetRunner::start();
} }
@@ -102,9 +104,9 @@ QnxDebugSupport::QnxDebugSupport(RunControl *runControl)
debuggeeRunner->addStartDependency(m_portsGatherer); debuggeeRunner->addStartDependency(m_portsGatherer);
auto slog2InfoRunner = new Slog2InfoRunner(runControl); auto slog2InfoRunner = new Slog2InfoRunner(runControl);
slog2InfoRunner->addStartDependency(debuggeeRunner); debuggeeRunner->addStartDependency(slog2InfoRunner);
addStartDependency(slog2InfoRunner); addStartDependency(debuggeeRunner);
} }
void QnxDebugSupport::start() void QnxDebugSupport::start()
@@ -136,15 +138,9 @@ void QnxDebugSupport::start()
if (qtVersion) if (qtVersion)
params.solibSearchPath = QnxUtils::searchPaths(qtVersion); params.solibSearchPath = QnxUtils::searchPaths(qtVersion);
reportStarted(); setStartParameters(params);
}
void QnxDebugSupport::stop() DebuggerRunTool::start();
{
// We have to kill the inferior process, as invoking "kill" in
// gdb doesn't work on QNX gdb.
auto stdRunnable = runnable().as<StandardRunnable>();
device()->signalOperation()->killProcess(stdRunnable.executable);
} }
} // namespace Internal } // namespace Internal

View File

@@ -39,7 +39,6 @@ public:
private: private:
void start() override; void start() override;
void stop() override;
Debugger::GdbServerPortsGatherer *m_portsGatherer; Debugger::GdbServerPortsGatherer *m_portsGatherer;
}; };

View File

@@ -43,6 +43,7 @@ namespace Internal {
Slog2InfoRunner::Slog2InfoRunner(RunControl *runControl) Slog2InfoRunner::Slog2InfoRunner(RunControl *runControl)
: RunWorker(runControl) : RunWorker(runControl)
{ {
setDisplayName("Slog2InfoRunner");
auto qnxRunConfig = qobject_cast<QnxRunConfiguration *>(runControl->runConfiguration()); auto qnxRunConfig = qobject_cast<QnxRunConfiguration *>(runControl->runConfiguration());
QTC_ASSERT(qnxRunConfig, return); QTC_ASSERT(qnxRunConfig, return);
m_applicationId = FileName::fromString(qnxRunConfig->remoteExecutableFilePath()).fileName(); m_applicationId = FileName::fromString(qnxRunConfig->remoteExecutableFilePath()).fileName();
@@ -75,6 +76,7 @@ void Slog2InfoRunner::start()
StandardRunnable r; StandardRunnable r;
r.executable = QLatin1String("slog2info"); r.executable = QLatin1String("slog2info");
m_testProcess->start(r); m_testProcess->start(r);
reportStarted();
} }
void Slog2InfoRunner::stop() void Slog2InfoRunner::stop()
@@ -86,6 +88,7 @@ void Slog2InfoRunner::stop()
m_logProcess->kill(); m_logProcess->kill();
processLog(true); processLog(true);
} }
reportStopped();
} }
bool Slog2InfoRunner::commandFound() const bool Slog2InfoRunner::commandFound() const

View File

@@ -243,7 +243,7 @@ def getOutputFromCmdline(cmdline, environment=None, acceptedError=0):
test.warning("Command '%s' returned %d" % (e.cmd, e.returncode)) test.warning("Command '%s' returned %d" % (e.cmd, e.returncode))
return e.output return e.output
def selectFromFileDialog(fileName, waitForFile=False): def selectFromFileDialog(fileName, waitForFile=False, ignoreFinalSnooze=False):
if platform.system() == "Darwin": if platform.system() == "Darwin":
snooze(1) snooze(1)
nativeType("<Command+Shift+g>") nativeType("<Command+Shift+g>")
@@ -253,7 +253,8 @@ def selectFromFileDialog(fileName, waitForFile=False):
nativeType("<Return>") nativeType("<Return>")
snooze(3) snooze(3)
nativeType("<Return>") nativeType("<Return>")
snooze(1) if not ignoreFinalSnooze:
snooze(1)
else: else:
fName = os.path.basename(os.path.abspath(fileName)) fName = os.path.basename(os.path.abspath(fileName))
pName = os.path.dirname(os.path.abspath(fileName)) + os.sep pName = os.path.dirname(os.path.abspath(fileName)) + os.sep
@@ -271,9 +272,12 @@ def selectFromFileDialog(fileName, waitForFile=False):
nativeType("<Ctrl+a>") nativeType("<Ctrl+a>")
nativeType("<Delete>") nativeType("<Delete>")
nativeType(pName + fName) nativeType(pName + fName)
snooze(1) seconds = len(pName + fName) / 20
test.log("Using snooze(%d) [problems with event processing of nativeType()]" % seconds)
snooze(seconds)
nativeType("<Return>") nativeType("<Return>")
snooze(3) if not ignoreFinalSnooze:
snooze(3)
if waitForFile: if waitForFile:
fileCombo = waitForObject(":Qt Creator_FilenameQComboBox") fileCombo = waitForObject(":Qt Creator_FilenameQComboBox")
if not waitFor("str(fileCombo.currentText) in fileName", 5000): if not waitFor("str(fileCombo.currentText) in fileName", 5000):

View File

@@ -99,7 +99,7 @@ def main():
model = waitForObject(":Qt Creator.Issues_QListView").model() model = waitForObject(":Qt Creator.Issues_QListView").model()
test.verify(model.rowCount() == 0, 'Got an empty issue list to start from.') test.verify(model.rowCount() == 0, 'Got an empty issue list to start from.')
invokeMenuItem("File", "Open File or Project...") invokeMenuItem("File", "Open File or Project...")
selectFromFileDialog(tasksFile) selectFromFileDialog(tasksFile, False, True)
starttime = datetime.utcnow() starttime = datetime.utcnow()
waitFor("model.rowCount() == expectedNo", 10000) waitFor("model.rowCount() == expectedNo", 10000)
endtime = datetime.utcnow() endtime = datetime.utcnow()

View File

@@ -183,7 +183,7 @@ TEST_F(DocumentSuspenderResumer, CategorizeWithMoreVisibleDocumentsThanHotDocume
ASSERT_THAT(coldDocuments, IsEmpty()); ASSERT_THAT(coldDocuments, IsEmpty());
} }
TEST_F(DocumentSuspenderResumer, CreateSuspendJobForInvisible) TEST_F(DocumentSuspenderResumer, DISABLED_WITHOUT_SUSPEND_PATCH(CreateSuspendJobForInvisible))
{ {
Document document = documents.create({fileContainer1})[0]; Document document = documents.create({fileContainer1})[0];
document.setIsSuspended(false); document.setIsSuspended(false);
@@ -199,7 +199,7 @@ TEST_F(DocumentSuspenderResumer, CreateSuspendJobForInvisible)
ASSERT_THAT(jobs, ContainerEq(expectedJobs)); ASSERT_THAT(jobs, ContainerEq(expectedJobs));
} }
TEST_F(DocumentSuspenderResumer, DoNotCreateSuspendJobForVisible) TEST_F(DocumentSuspenderResumer, DISABLED_WITHOUT_SUSPEND_PATCH(DoNotCreateSuspendJobForVisible))
{ {
Document document = documents.create({fileContainer1})[0]; Document document = documents.create({fileContainer1})[0];
document.setIsSuspended(false); document.setIsSuspended(false);
@@ -210,7 +210,7 @@ TEST_F(DocumentSuspenderResumer, DoNotCreateSuspendJobForVisible)
ASSERT_THAT(jobs, IsEmpty()); ASSERT_THAT(jobs, IsEmpty());
} }
TEST_F(DocumentSuspenderResumer, DoNotCreateSuspendJobForUnparsed) TEST_F(DocumentSuspenderResumer, DISABLED_WITHOUT_SUSPEND_PATCH(DoNotCreateSuspendJobForUnparsed))
{ {
Document document = documents.create({fileContainer1})[0]; Document document = documents.create({fileContainer1})[0];
document.setIsSuspended(false); document.setIsSuspended(false);
@@ -221,7 +221,7 @@ TEST_F(DocumentSuspenderResumer, DoNotCreateSuspendJobForUnparsed)
ASSERT_THAT(jobs, IsEmpty()); ASSERT_THAT(jobs, IsEmpty());
} }
TEST_F(DocumentSuspenderResumer, CreateSuspendJobsForDocumentWithSupportiveTranslationUnit) TEST_F(DocumentSuspenderResumer, DISABLED_WITHOUT_SUSPEND_PATCH(CreateSuspendJobsForDocumentWithSupportiveTranslationUnit))
{ {
Document document = documents.create({fileContainer1})[0]; Document document = documents.create({fileContainer1})[0];
document.setIsSuspended(false); document.setIsSuspended(false);
@@ -238,7 +238,7 @@ TEST_F(DocumentSuspenderResumer, CreateSuspendJobsForDocumentWithSupportiveTrans
ASSERT_THAT(jobs, ContainerEq(expectedJobs)); ASSERT_THAT(jobs, ContainerEq(expectedJobs));
} }
TEST_F(DocumentSuspenderResumer, CreateResumeJob) TEST_F(DocumentSuspenderResumer, DISABLED_WITHOUT_SUSPEND_PATCH(CreateResumeJob))
{ {
Document document = documents.create({fileContainer1})[0]; Document document = documents.create({fileContainer1})[0];
document.setIsSuspended(true); document.setIsSuspended(true);
@@ -252,7 +252,7 @@ TEST_F(DocumentSuspenderResumer, CreateResumeJob)
ASSERT_THAT(jobs, ContainerEq(expectedJobs)); ASSERT_THAT(jobs, ContainerEq(expectedJobs));
} }
TEST_F(DocumentSuspenderResumer, DoNotCreateResumeJobForInvisible) TEST_F(DocumentSuspenderResumer, DISABLED_WITHOUT_SUSPEND_PATCH(DoNotCreateResumeJobForInvisible))
{ {
Document document = documents.create({fileContainer1})[0]; Document document = documents.create({fileContainer1})[0];
document.setIsSuspended(true); document.setIsSuspended(true);
@@ -263,7 +263,7 @@ TEST_F(DocumentSuspenderResumer, DoNotCreateResumeJobForInvisible)
ASSERT_THAT(jobs, IsEmpty()); ASSERT_THAT(jobs, IsEmpty());
} }
TEST_F(DocumentSuspenderResumer, CreateResumeJobsForDocumentWithSupportiveTranslationUnit) TEST_F(DocumentSuspenderResumer, DISABLED_WITHOUT_SUSPEND_PATCH(CreateResumeJobsForDocumentWithSupportiveTranslationUnit))
{ {
Document document = documents.create({fileContainer1})[0]; Document document = documents.create({fileContainer1})[0];
document.setIsSuspended(true); document.setIsSuspended(true);
@@ -279,7 +279,7 @@ TEST_F(DocumentSuspenderResumer, CreateResumeJobsForDocumentWithSupportiveTransl
ASSERT_THAT(jobs, ContainerEq(expectedJobs)); ASSERT_THAT(jobs, ContainerEq(expectedJobs));
} }
TEST_F(DocumentSuspenderResumer, CreateSuspendAndResumeJobs) TEST_F(DocumentSuspenderResumer, DISABLED_WITHOUT_SUSPEND_PATCH(CreateSuspendAndResumeJobs))
{ {
Document hotDocument = documents.create({fileContainer1})[0]; Document hotDocument = documents.create({fileContainer1})[0];
hotDocument.setIsSuspended(true); hotDocument.setIsSuspended(true);

View File

@@ -58,7 +58,7 @@ TEST_F(SuspendDocumentJob, RunAsync)
ASSERT_TRUE(waitUntilJobFinished(job)); ASSERT_TRUE(waitUntilJobFinished(job));
} }
TEST_F(SuspendDocumentJob, DocumentIsSuspendedAfterRun) TEST_F(SuspendDocumentJob, DISABLED_WITHOUT_SUSPEND_PATCH(DocumentIsSuspendedAfterRun))
{ {
document.parse(); document.parse();
job.setContext(jobContext); job.setContext(jobContext);

View File

@@ -26,6 +26,8 @@
#include <QtGlobal> #include <QtGlobal>
#include <clang-c/Index.h> #include <clang-c/Index.h>
#include <clangbackend_global.h>
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
# define DISABLED_ON_WINDOWS(x) DISABLED_##x # define DISABLED_ON_WINDOWS(x) DISABLED_##x
#else #else
@@ -37,3 +39,9 @@
#else #else
# define DISABLED_ON_CLANG3(x) x # define DISABLED_ON_CLANG3(x) x
#endif #endif
#ifdef IS_SUSPEND_SUPPORTED
# define DISABLED_WITHOUT_SUSPEND_PATCH(x) x
#else
# define DISABLED_WITHOUT_SUSPEND_PATCH(x) DISABLED_##x
#endif