diff --git a/doc/images/qtcreator-add-online-doc.png b/doc/images/qtcreator-add-online-doc.png index ca9e148b42a..c607de32d8e 100644 Binary files a/doc/images/qtcreator-add-online-doc.png and b/doc/images/qtcreator-add-online-doc.png differ diff --git a/doc/images/qtcreator-navigate-customfilter.png b/doc/images/qtcreator-navigate-customfilter.png index bf8943d4457..31f07254928 100644 Binary files a/doc/images/qtcreator-navigate-customfilter.png and b/doc/images/qtcreator-navigate-customfilter.png differ diff --git a/doc/src/editors/creator-clang-codemodel.qdoc b/doc/src/editors/creator-clang-codemodel.qdoc index ed50ef8d57a..5effcc64583 100644 --- a/doc/src/editors/creator-clang-codemodel.qdoc +++ b/doc/src/editors/creator-clang-codemodel.qdoc @@ -55,19 +55,20 @@ \endlist - An IDE needs a parser for the language and the semantic analyzes. The only - difference between a code model and a compiler is that a code model does not - generate an executable. + An IDE needs a parser for the language and the semantic analyzes. - As \l{http://clang.llvm.org/}{Clang} is a compiler, as well as a code model, - it provides accurate information. The feedback you get through warning and - error markers is the same as the compiler will give you, not an incomplete + \section1 Using Clang Code Model + + The \l{http://clang.llvm.org/}{Clang} project provides libraries for parsing + C and C++ source files. The feedback you get through warning and + error markers is the same as a compiler will give you, not an incomplete set or a close approximation, as when using the built-in \QC code model. Clang focuses on detailed information for diagnostics, which is really useful if the code contains typos, for example. - Also, Clang already supports C++98/03, C89 and C99, Objective-C (and - Objective-C++), and C++11 support is in active development. + Clang keeps up with the development of the C++ language. At the time of this + writing, it supports C++98/03, C++11, C++14, C89, C99, Objective-C, and + Objective-C++. On the downside, for large projects using Clang as code model is slower than using the built-in code model. Clang does not need to generate object files, @@ -84,14 +85,14 @@ \list - \li Highlighting \li Code completion + \li Syntactic and semantic highlighting \endlist To use the plugin, you must build it and configure it in \QC. - \section1 Building Clang Code Model Plugin + \section2 Building Clang Code Model Plugin \list 1 @@ -138,7 +139,7 @@ \li Installed via package manager on Linux: - \c {LLVM_INSTALL_DIR=/usr/lib/llvm-3.4} + \c {LLVM_INSTALL_DIR=/usr/lib/llvm-3.6} \li Manually built on Unix in release mode: @@ -154,7 +155,7 @@ \endlist - \section1 Configuring Clang Code Model Plugin + \section2 Configuring Clang Code Model Plugin \list 1 diff --git a/doc/src/editors/creator-coding-edit-mode.qdoc b/doc/src/editors/creator-coding-edit-mode.qdoc index 6793f96cfd5..f80aec704d5 100644 --- a/doc/src/editors/creator-coding-edit-mode.qdoc +++ b/doc/src/editors/creator-coding-edit-mode.qdoc @@ -168,8 +168,8 @@ \key {Ctrl+E,F2} to follow the symbol in the next split. If necessary, the view is automatically split. To change the default behavior, select \uicontrol Tools > \uicontrol Options > \uicontrol {Text Editor} > - \uicontrol Display, and then select - \uicontrol {Always Open Links in Next Split}. Additional symbols are + \uicontrol Display > \uicontrol {Always open links in another split}. + Additional symbols are displayed and switching between definition and declaration is done in another split. If you change the default behavior, the shortcuts for opening link targets in the next split are used to open them in the current split. @@ -197,5 +197,5 @@ \QC underlines semantic errors in olive in the C++ code editor. To check the correct paths for includes that are not resolved or that are resolved to the - wrong file, select \uicontrol {Project Parts} > \uicontrol {Include Paths}. + wrong file, select \uicontrol {Project Parts} > \uicontrol {Header Paths}. */ diff --git a/doc/src/editors/creator-editors.qdoc b/doc/src/editors/creator-editors.qdoc index 22e93118fb5..1ee685c844d 100644 --- a/doc/src/editors/creator-editors.qdoc +++ b/doc/src/editors/creator-editors.qdoc @@ -787,9 +787,9 @@ Select \uicontrol Tools > \uicontrol Options > \uicontrol {Text Editor} > \uicontrol Completion. - By default, code completion considers only the first letter case-sensitive. - To apply full or no case-sensitivity, select the option in the - \uicontrol {Case-sensitivity} field. + By default, code completion does not consider case. To apply full or + first-letter case-sensitivity, select \uicontrol Full or + \uicontrol {First Letter} in the \uicontrol {Case-sensitivity} field. \section2 Summary of Available Types @@ -1291,7 +1291,8 @@ \section2 Specifying Tabs and Indentation - You can specify tab policy and tab size in the \uicontrol Typing group. In + You can specify tab policy and tab size in the + \uicontrol {Tabs and Indentation} group. In the \uicontrol {Tab policy} field, select whether to use only spaces or only tabs for indentation, or to use a mixture of them. @@ -1416,7 +1417,7 @@ \li To search only whole words, select \uicontrol {Whole Words Only}. \li To search using regular expressions, select - \uicontrol {Regular Expressions}. Regular expressions used in \QC + \uicontrol {Use Regular Expressions}. Regular expressions used in \QC are modeled on Perl regular expressions. For more information on using regular expressions, see the documentation for the QRegularExpression Class. @@ -1444,7 +1445,7 @@ The \uicontrol {Preserve Case when Replacing} option can be selected to preserve the case of the original text when replacing. This option is not - compatible with the \uicontrol {Regular Expressions} search option, and will + compatible with the \uicontrol {Use Regular Expressions} search option, and will thus be disabled when regular expressions are used. When the option is used, the case of the occurrence will be conserved, according to the following rules: @@ -1469,7 +1470,7 @@ The locations of search hits, breakpoints, and bookmarks in your document are highlighted on the editor scroll bar. To turn highlighting off, select \uicontrol Tools > \uicontrol Options > \uicontrol {Text Editor} > - \uicontrol {Highlight search results on the scrollbar}. + \uicontrol Display > \uicontrol {Highlight search results on the scrollbar}. \section1 Advanced Search @@ -2532,8 +2533,8 @@ \li Specify the prefix string. - \li To show only results matching this filter, select - \uicontrol {Limit to prefix}. + \li To implicitly include the filter even when not typing a prefix as a + part of the search string, select \uicontrol {Include by default}. \li Specify other available options. For more information, see \l{Adding Web Search Engines}. @@ -2601,8 +2602,9 @@ \li Specify the prefix string. - To show only results matching this filter, select - \uicontrol {Limit to prefix}. + To implicitly include the filter even when not typing a prefix + as a part of the search string, select + \uicontrol {Include by default}. \image qtcreator-navigate-customfilter.png diff --git a/doc/src/widgets/qtdesigner-plugins.qdoc b/doc/src/widgets/qtdesigner-plugins.qdoc index cc4052056af..3925e86e3ea 100644 --- a/doc/src/widgets/qtdesigner-plugins.qdoc +++ b/doc/src/widgets/qtdesigner-plugins.qdoc @@ -50,19 +50,20 @@ and integrated into \QC. The correct folder to place the plugins depends on whether you use the standalone \QD or the integrated \QD. - The integrated \QD fetches plugins from the \c {%SDK%\bin\designer} folder - on Windows and Linux. For information about how to configure plugins on - OS X, see \l{Configuring Qt Designer Plugins on OS X}. + The integrated \QD fetches plugins from the \c {\bin\plugins\designer} + directory in the \QC installation directory on Windows and Linux. For + information about how to configure plugins on OS X, see + \l{Configuring Qt Designer Plugins on OS X}. - To check which plugins - were loaded successfully and which failed, choose \uicontrol{Tools > Form Editor > - About Qt Designer Plugins}. + To check which plugins were loaded successfully and which failed, choose + \uicontrol Tools > \uicontrol {Form Editor} > + \uicontrol {About Qt Designer Plugins}. The standalone \QD is part of the Qt library used for building projects, - located under \c {%SDK%\qt}. Therefore, it fetches plugins from the - following folder: \c {%SDK%\qt\plugins\designer}. To check which plugins - were loaded successfully and which failed, choose \uicontrol{Help > - About Plugins}. + located in \c {\\bin} in the Qt installation + directory. It fetches plugins from the \c {\plugins\designer} subdirectory + of \c bin. To check which plugins were loaded successfully and which failed, + choose \uicontrol Help > \uicontrol {About Plugins}. \section2 Configuring Qt Designer Plugins on OS X diff --git a/scripts/clangCompleteAt.sh b/scripts/clangCompleteAt.sh new file mode 100755 index 00000000000..a588e9aa7f2 --- /dev/null +++ b/scripts/clangCompleteAt.sh @@ -0,0 +1,150 @@ +#!/bin/sh + +################################################################################ +# Copyright (C) 2015 The Qt Company Ltd. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of The Qt Company Ltd, nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +################################################################################ + +# --- helpers ----------------------------------------------------------------- + +printUsage() +{ + echo "Usage: $0 [-v] [-c clang-executable] file line column" + echo + echo "Options:" + echo " -v Run c-index-test instead of clang to get more details." + echo " -c clang-executable Use the provided clang-executable." + echo + echo "The clang executable is determined by this order:" + echo " 1. Use clang from the -c option." + echo " 2. Use clang from environment variable CLANG_FOR_COMPLETION." + echo " 3. Use clang from \$PATH." + echo + echo "Path to c-index-test will be determined with the help of the clang executable." +} + +# There is no readlink on cygwin. +hasReadLink() +{ + return $(command -v readlink >/dev/null 2>&1) +} + +checkIfFileExistsOrDie() +{ + [ ! -f "$1" ] && echo "'$1' is not a file or does not exist." && exit 1 +} + +checkIfFileExistsAndIsExecutableOrDie() +{ + checkIfFileExistsOrDie "$1" + [ ! -x "$1" ] && echo "'$1' is not executable." && exit 2 +} + +findClangOrDie() +{ + if [ -z "$CLANG_EXEC" ]; then + if [ -n "${CLANG_FOR_COMPLETION}" ]; then + CLANG_EXEC=${CLANG_FOR_COMPLETION} + else + CLANG_EXEC=$(which clang) + fi + fi + hasReadLink && CLANG_EXEC=$(readlink -e "$CLANG_EXEC") + checkIfFileExistsAndIsExecutableOrDie "$CLANG_EXEC" +} + +findCIndexTestOrDie() +{ + if [ -n "$RUN_WITH_CINDEXTEST" ]; then + CINDEXTEST_EXEC=$(echo $CLANG_EXEC | sed -e 's/clang/c-index-test/g') + hasReadLink && CINDEXTEST_EXEC=$(readlink -e "$CINDEXTEST_EXEC") + checkIfFileExistsAndIsExecutableOrDie "$CINDEXTEST_EXEC" + fi +} + +printClangVersion() +{ + command="${CLANG_EXEC} --version" + echo "Command: $command" + eval $command +} + +runCodeCompletion() +{ + if [ -n "${CINDEXTEST_EXEC}" ]; then + command="${CINDEXTEST_EXEC} -code-completion-at=${FILE}:${LINE}:${COLUMN} ${FILE}" + else + command="${CLANG_EXEC} -cc1 -code-completion-at ${FILE}:${LINE}:${COLUMN} ${FILE}" + fi + echo "Command: $command" + eval $command +} + +# --- Process arguments ------------------------------------------------------- + +CLANG_EXEC= +RUN_WITH_CINDEXTEST= + +FILE= +LINE= +COLUMN= + +while [ -n "$1" ]; do + param=$1 + shift + case $param in + -h | -help | --help) + printUsage + exit 0 + ;; + -v | -verbose | --verbose) + RUN_WITH_CINDEXTEST=1 + ;; + -c | -clang | --clang) + CLANG_EXEC=$1 + shift + ;; + *) + break; + ;; + esac +done + +[ "$#" -ne 2 ] && printUsage && exit 1 +checkIfFileExistsOrDie "$param" +FILE=$param +LINE=$1 +COLUMN=$2 + +# --- main -------------------------------------------------------------------- + +findClangOrDie +findCIndexTestOrDie + +printClangVersion +echo +runCodeCompletion + diff --git a/src/app/app.qbs b/src/app/app.qbs index c47fde658c0..6f585d6ce61 100644 --- a/src/app/app.qbs +++ b/src/app/app.qbs @@ -56,6 +56,6 @@ QtcProduct { Group { fileTagsFilter: product.type qbs.install: true - qbs.installDir: project.ide_app_path + qbs.installDir: project.ide_bin_path } } diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 441af54b5af..e310efe6f2b 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -847,7 +847,6 @@ void PluginManagerPrivate::nextDelayedInitialize() \internal */ PluginManagerPrivate::PluginManagerPrivate(PluginManager *pluginManager) : - m_failedTests(0), delayedInitializeTimer(0), shutdownEventLoop(0), m_profileElapsedMS(0), @@ -1127,6 +1126,7 @@ void PluginManagerPrivate::startTests() return; } + int failedTests = 0; foreach (const PluginManagerPrivate::TestSpec &testSpec, testSpecs) { IPlugin *plugin = testSpec.pluginSpec->plugin(); if (!plugin) @@ -1144,10 +1144,10 @@ void PluginManagerPrivate::startTests() ? generateCompleteTestPlan(plugin, testObjects) : generateCustomTestPlan(plugin, testObjects, testSpec.testFunctionsOrObjects); - m_failedTests += executeTestPlan(testPlan); + failedTests += executeTestPlan(testPlan); } - if (!testSpecs.isEmpty()) - QTimer::singleShot(1, this, SLOT(exitWithNumberOfFailedTests())); + + QTimer::singleShot(0, this, [failedTests]() { emit m_instance->testsFinished(failedTests); }); } #endif @@ -1270,14 +1270,6 @@ void PluginManagerPrivate::asyncShutdownFinished() shutdownEventLoop->exit(); } -/*! - \internal -*/ -void PluginManagerPrivate::exitWithNumberOfFailedTests() -{ - QCoreApplication::exit(m_failedTests); -} - /*! \internal */ diff --git a/src/libs/extensionsystem/pluginmanager.h b/src/libs/extensionsystem/pluginmanager.h index 7b0ee066f4b..cbf0a2fe4df 100644 --- a/src/libs/extensionsystem/pluginmanager.h +++ b/src/libs/extensionsystem/pluginmanager.h @@ -158,6 +158,7 @@ signals: void pluginsChanged(); void initializationDone(); + void testsFinished(int failedTests); public slots: void remoteArguments(const QString &serializedArguments, QObject *socket); diff --git a/src/libs/extensionsystem/pluginmanager_p.h b/src/libs/extensionsystem/pluginmanager_p.h index f219d5c0dae..eb293977f45 100644 --- a/src/libs/extensionsystem/pluginmanager_p.h +++ b/src/libs/extensionsystem/pluginmanager_p.h @@ -102,7 +102,6 @@ public: QHash pluginCategories; QList pluginSpecs; QList testSpecs; - int m_failedTests; QStringList pluginPaths; QString pluginIID; QList allObjects; // ### make this a QList > > ? @@ -138,7 +137,6 @@ public: private slots: void nextDelayedInitialize(); void asyncShutdownFinished(); - void exitWithNumberOfFailedTests(); private: PluginCollection *defaultCollection; diff --git a/src/libs/qmljs/qmljslink.cpp b/src/libs/qmljs/qmljslink.cpp index d9dc7f2ba95..d91ef336f95 100644 --- a/src/libs/qmljs/qmljslink.cpp +++ b/src/libs/qmljs/qmljslink.cpp @@ -440,6 +440,8 @@ Import LinkPrivate::importNonFile(Document::Ptr doc, const ImportInfo &importInf "Import paths:\n" "%1\n\n" "For qmake projects, use the QML_IMPORT_PATH variable to add import paths.\n" + "For qbs projects, declare and set a qmlImportPaths property in your product " + "to add import paths.\n" "For qmlproject projects, use the importPaths property to add import paths.").arg( importPaths.join(QLatin1Char('\n')))); } diff --git a/src/plugins/clangcodemodel/README b/src/plugins/clangcodemodel/README index 0485e71076b..84e2a30d8e0 100644 --- a/src/plugins/clangcodemodel/README +++ b/src/plugins/clangcodemodel/README @@ -1,59 +1 @@ -The ClangCodeModel plugin -========================= - -The ClangCodeModel plugin integrates the clang frontend into Qt Creator. Clang -is "a C language family frontend for LLVM". You can find more information at -http://clang.llvm.org/. - -At the time of writing the plugin can replace the following functionality of -the built-in code model: - * Highlighting - * Completion - -All other functionality relies on the built-in code model (indexing, quick -fixes, follow symbol, find usages, ...). - -Setup -===== - -Compile the plugin ------------------- - -1. Get libclang - -You need to have libclang (and thus llvm) installed on your system. Either -build llvm/clang yourself [1], install some ready-to-use package [2] or use the -package manager of your system. - - [1] http://clang.llvm.org/get_started.html - See http://llvm.org/docs/GettingStarted.html#git-mirror for git mirrors. - [2] http://llvm.org/releases/ or http://llvm.org/builds/ - -If you are building llvm/clang yourself, make sure to build it in release mode. - -2. Set LLVM_INSTALL_DIR and (re)build Qt Creator - -Point the LLVM_INSTALL_DIR variable to the build/installation directory of -llvm, e.g.: - - Installed via package manager on GNU/Linux: - LLVM_INSTALL_DIR=/usr/lib/llvm-3.4 - Manually build on Unix in release mode: - LLVM_INSTALL_DIR=$HOME/llvm-build/Release+Asserts - Installed a snapshot on Windows: - LLVM_INSTALL_DIR=C:\llvm - -Set the variable either as part of the build environment or pass it directly to -qmake and rebuild Qt Creator. - -Enable the plugin ------------------ - -Enable the "ClangCodeModel" plugin in the dialog "Menu: Help -> About Plugins" -and restart Qt Creator. - -Select the file types you want to use the ClangCodeModel for in "Menu: Tools -> -Options -> C++ -> Tab: Code Model". For the next opened file matching the -selected file types the ClangCodeModel will be used (see limitations at the -start of this README). - +See ../../../doc/src/editors/creator-clang-codemodel.qdoc diff --git a/src/plugins/clangcodemodel/clangutils.cpp b/src/plugins/clangcodemodel/clangutils.cpp index 02f448644fe..f0f68030fc9 100644 --- a/src/plugins/clangcodemodel/clangutils.cpp +++ b/src/plugins/clangcodemodel/clangutils.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -147,7 +148,17 @@ private: bool excludeHeaderPath(const QString &path) const override { - return path.contains(QLatin1String("lib/gcc/i686-apple-darwin")); + if (path.contains(QLatin1String("lib/gcc/i686-apple-darwin"))) + return true; + + // We already provide a custom clang include path matching the used libclang version, + // so better ignore the clang include paths from the system as this might lead to an + // unfavorable order with regard to include_next. + static QRegExp clangIncludeDir(QLatin1String(".*/lib/clang/\\d+\\.\\d+\\.\\d+/include")); + if (clangIncludeDir.exactMatch(path)) + return true; + + return false; } void addResourceDirOptions() diff --git a/src/plugins/clangcodemodel/completionchunkstotextconverter.cpp b/src/plugins/clangcodemodel/completionchunkstotextconverter.cpp index f8f76989f14..3b4f5b62777 100644 --- a/src/plugins/clangcodemodel/completionchunkstotextconverter.cpp +++ b/src/plugins/clangcodemodel/completionchunkstotextconverter.cpp @@ -79,6 +79,16 @@ void CompletionChunksToTextConverter::setAddExtraVerticalSpaceBetweenBraces(bool m_addExtraVerticalSpaceBetweenBraces = addExtraVerticalSpaceBetweenBraces; } +void CompletionChunksToTextConverter::setAddHtmlTags(bool addHtmlTags) +{ + m_addHtmlTags = addHtmlTags; +} + +void CompletionChunksToTextConverter::setAddOptional(bool addOptional) +{ + m_addOptional = addOptional; +} + const QString &CompletionChunksToTextConverter::text() const { return m_text; @@ -99,6 +109,7 @@ QString CompletionChunksToTextConverter::convertToFunctionSignature(const ClangB CompletionChunksToTextConverter converter; converter.setAddPlaceHolderText(true); converter.setAddResultType(true); + converter.setAddOptional(true); converter.parseChunks(codeCompletionChunks); @@ -120,6 +131,9 @@ QString CompletionChunksToTextConverter::convertToToolTip(const ClangBackEnd::Co converter.setAddPlaceHolderText(true); converter.setAddSpaces(true); converter.setAddExtraVerticalSpaceBetweenBraces(true); + converter.setAddOptional(true); + converter.setAddHtmlTags(true); + converter.setAddResultType(true); converter.parseChunks(codeCompletionChunks); @@ -158,11 +172,15 @@ void CompletionChunksToTextConverter::parseText(const Utf8String &text) void CompletionChunksToTextConverter::parseOptional(const ClangBackEnd::CodeCompletionChunk &optionalCodeCompletionChunk) { - m_text += QStringLiteral(""); + if (m_addOptional) { + if (m_addHtmlTags) + m_text += QStringLiteral(""); - m_text += convertToFunctionSignature(optionalCodeCompletionChunk.optionalChunks()); + m_text += convertToFunctionSignature(optionalCodeCompletionChunk.optionalChunks()); - m_text += QStringLiteral(""); + if (m_addHtmlTags) + m_text += QStringLiteral(""); + } } void CompletionChunksToTextConverter::parsePlaceHolder(const ClangBackEnd::CodeCompletionChunk &codeCompletionChunk) diff --git a/src/plugins/clangcodemodel/completionchunkstotextconverter.h b/src/plugins/clangcodemodel/completionchunkstotextconverter.h index 68c2bbcd149..174479d3640 100644 --- a/src/plugins/clangcodemodel/completionchunkstotextconverter.h +++ b/src/plugins/clangcodemodel/completionchunkstotextconverter.h @@ -52,6 +52,8 @@ public: void setAddResultType(bool addResultType); void setAddSpaces(bool addSpaces); void setAddExtraVerticalSpaceBetweenBraces(bool addExtraVerticalSpaceBetweenBraces); + void setAddHtmlTags(bool addHtmlTags); + void setAddOptional(bool addOptional); const QString &text() const; const std::vector &placeholderPositions() const; @@ -83,6 +85,8 @@ private: bool m_addResultType = false; bool m_addSpaces = false; bool m_addExtraVerticalSpaceBetweenBraces = false; + bool m_addHtmlTags = false; + bool m_addOptional = false; }; } // namespace Internal diff --git a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp index 3b5cbef89aa..215c434d69c 100644 --- a/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp +++ b/src/plugins/clangcodemodel/test/clangcodecompletion_test.cpp @@ -868,8 +868,8 @@ void ClangCodeCompletionTest::testCompleteFunctions() QVERIFY(hasItem(t.proposal, "void f()")); QVERIFY(hasItem(t.proposal, "void f(int a)")); QVERIFY(hasItem(t.proposal, "void f(const QString &s)")); - QVERIFY(hasItem(t.proposal, "void f(char c, int optional)")); // TODO: No default argument? - QVERIFY(hasItem(t.proposal, "void f(char c, int optional1, int optional2)")); // TODO: No default argument? + QVERIFY(hasItem(t.proposal, "void f(char c, int optional)")); // TODO: No default argument? + QVERIFY(hasItem(t.proposal, "void f(char c, int optional1, int optional2)")); // TODO: No default argument? QVERIFY(hasItem(t.proposal, "void f(const TType *t)")); QVERIFY(hasItem(t.proposal, "TType f(bool)")); } diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 89047d7684d..f295620f500 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -323,6 +323,10 @@ ICore::ICore(MainWindow *mainwindow) // Save settings once after all plugins are initialized: connect(PluginManager::instance(), SIGNAL(initializationDone()), this, SLOT(saveSettings())); + connect(PluginManager::instance(), &PluginManager::testsFinished, [this] (int failedTests) { + emit coreAboutToClose(); + QCoreApplication::exit(failedTests); + }); connect(m_mainwindow, SIGNAL(newItemDialogRunningChanged()), this, SIGNAL(newItemDialogRunningChanged())); } diff --git a/src/plugins/coreplugin/locator/directoryfilter.cpp b/src/plugins/coreplugin/locator/directoryfilter.cpp index bce79a63893..8b719ca3dd2 100644 --- a/src/plugins/coreplugin/locator/directoryfilter.cpp +++ b/src/plugins/coreplugin/locator/directoryfilter.cpp @@ -100,7 +100,7 @@ bool DirectoryFilter::openConfigDialog(QWidget *parent, bool &needsRefresh) m_ui.prefixLabel->setText(ILocatorFilter::msgPrefixLabel()); m_ui.prefixLabel->setToolTip(ILocatorFilter::msgPrefixToolTip()); m_ui.defaultFlag->setText(ILocatorFilter::msgIncludeByDefault()); - m_ui.defaultFlag->setText(ILocatorFilter::msgIncludeByDefaultToolTip()); + m_ui.defaultFlag->setToolTip(ILocatorFilter::msgIncludeByDefaultToolTip()); connect(m_ui.addButton, &QPushButton::clicked, this, &DirectoryFilter::addDirectory, Qt::DirectConnection); connect(m_ui.editButton, &QPushButton::clicked, diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index d473fb735f4..c6e53e13fcf 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -230,13 +230,23 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor const QString toolchainPrefix = extractToolchainPrefix(&compilerName); if (!toolchainPrefix.isEmpty()) data.insert(QLatin1String(CPP_TOOLCHAINPREFIX), toolchainPrefix); - data.insert(QLatin1String(CPP_CXXCOMPILERNAME), compilerName); + if (toolchain.contains(QLatin1String("msvc"))) + data.insert(QLatin1String(CPP_COMPILERNAME), compilerName); + else + data.insert(QLatin1String(CPP_CXXCOMPILERNAME), compilerName); if (targetAbi.os() != ProjectExplorer::Abi::WindowsOS || targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMSysFlavor) { data.insert(QLatin1String(CPP_LINKERNAME), compilerName); } data.insert(QLatin1String(CPP_TOOLCHAINPATH), cxxFileInfo.absolutePath()); + // TODO: Remove this once compiler version properties are set for MSVC + if (targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2013Flavor + || targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2015Flavor) { + const QLatin1String flags("/FS"); + data.insert(QLatin1String(CPP_PLATFORMCFLAGS), flags); + data.insert(QLatin1String(CPP_PLATFORMCXXFLAGS), flags); + } return data; } diff --git a/src/plugins/qbsprojectmanager/qbsconstants.h b/src/plugins/qbsprojectmanager/qbsconstants.h index 666a7dc5773..b9ad484e443 100644 --- a/src/plugins/qbsprojectmanager/qbsconstants.h +++ b/src/plugins/qbsprojectmanager/qbsconstants.h @@ -41,8 +41,11 @@ const char QBS_ARCHITECTURE[] = "qbs.architecture"; const char QBS_TOOLCHAIN[] = "qbs.toolchain"; const char CPP_TOOLCHAINPATH[] = "cpp.toolchainInstallPath"; const char CPP_TOOLCHAINPREFIX[] = "cpp.toolchainPrefix"; +const char CPP_COMPILERNAME[] = "cpp.compilerName"; const char CPP_CXXCOMPILERNAME[] = "cpp.cxxCompilerName"; const char CPP_LINKERNAME[] = "cpp.linkerName"; +const char CPP_PLATFORMCFLAGS[] = "cpp.platformCFlags"; +const char CPP_PLATFORMCXXFLAGS[] = "cpp.platformCxxFlags"; const char CPP_PLATFORMPATH[] = "cpp.platformPath"; const char CPP_XCODESDKNAME[] = "cpp.xcodeSdkName"; const char CPP_XCODESDKVERSION[] = "cpp.xcodeSdkVersion"; diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index d1f8b3a2117..e6ff776ce7d 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -858,6 +858,13 @@ void QbsProject::updateQmlJsCodeModel() QmlJS::ModelManagerInterface::ProjectInfo projectInfo = modelManager->defaultProjectInfoForProject(this); + foreach (const qbs::ProductData &product, m_projectData.allProducts()) { + static const QString propertyName = QLatin1String("qmlImportPaths"); + foreach (const QString &path, product.properties().value(propertyName).toStringList()) { + projectInfo.importPaths.maybeInsert(Utils::FileName::fromString(path), + QmlJS::Dialect::Qml); + } + } setProjectLanguage(ProjectExplorer::Constants::LANG_QMLJS, !projectInfo.sourceFiles.isEmpty()); modelManager->updateProjectInfo(projectInfo, this); diff --git a/tests/unit/unittest/codecompletionsextractortest.cpp b/tests/unit/unittest/codecompletionsextractortest.cpp index 38a1190a3d3..eed59dde0a2 100644 --- a/tests/unit/unittest/codecompletionsextractortest.cpp +++ b/tests/unit/unittest/codecompletionsextractortest.cpp @@ -366,7 +366,7 @@ TEST_F(CodeCompletionsExtractor, Enumerator) CodeCompletion::Available)); } -TEST_F(CodeCompletionsExtractor, Constructor) +TEST_F(CodeCompletionsExtractor, DISABLED_Constructor) { ClangCodeCompleteResults completeResults(getResults(constructorTranslationUnit, 20)); diff --git a/tests/unit/unittest/codecompletiontest.cpp b/tests/unit/unittest/codecompletiontest.cpp index 62bbbb6b9ca..87658687175 100644 --- a/tests/unit/unittest/codecompletiontest.cpp +++ b/tests/unit/unittest/codecompletiontest.cpp @@ -28,107 +28,200 @@ ** ****************************************************************************/ -#include "gtest/gtest.h" -#include "gmock/gmock-matchers.h" -#include "gtest-qt-printing.h" - #include #include +#include #include #include #include -#include #include +#include +#include +#include +#include +#include "gtest-qt-printing.h" using ::testing::ElementsAreArray; using ::testing::Contains; using ::testing::AllOf; using ::testing::Not; +using ::testing::PrintToString; using ClangBackEnd::CodeCompletion; using ClangBackEnd::CodeCompleter; namespace { +MATCHER_P2(IsCodeCompletion, text, completionKind, + std::string(negation ? "isn't" : "is") + " code completion with text " + + PrintToString(text) + " and kind " + PrintToString(completionKind) + ) +{ + if (arg.text() != text) { + *result_listener << "text is " + PrintToString(arg.text()) + " and not " + PrintToString(text); + return false; + } + + if (arg.completionKind() != completionKind) { + *result_listener << "kind is " + PrintToString(arg.completionKind()) + " and not " + PrintToString(completionKind); + return false; + } + + return true; +} + class CodeCompleter : public ::testing::Test { -public: - static void SetUpTestCase(); - static void TearDownTestCase(); +protected: + void SetUp(); + void copyTargetHeaderToTemporaryIncludeDirecory(); + void copyChangedTargetHeaderToTemporaryIncludeDirecory(); + static Utf8String readFileContent(const QString &fileName); protected: - static ClangBackEnd::ProjectPart projectPart; - static ClangBackEnd::UnsavedFiles unsavedFiles; - static ClangBackEnd::TranslationUnit translationUnit; - static ClangBackEnd::CodeCompleter completer; + QTemporaryDir includeDirectory; + QString targetHeaderPath{includeDirectory.path() + QStringLiteral("/complete_target_header.h")}; + ClangBackEnd::ProjectPart projectPart{Utf8StringLiteral("projectPartId")}; + ClangBackEnd::UnsavedFiles unsavedFiles; + ClangBackEnd::TranslationUnit translationUnit{Utf8StringLiteral(TESTDATA_DIR"/complete_completer_main.cpp"), + unsavedFiles, + projectPart}; + ClangBackEnd::CodeCompleter completer{translationUnit}; + ClangBackEnd::FileContainer unsavedMainFileContainer{translationUnit.filePath(), + projectPart.projectPartId(), + readFileContent(QStringLiteral("/complete_completer_main_unsaved.cpp")), + true}; + ClangBackEnd::FileContainer unsavedTargetHeaderFileContainer{targetHeaderPath, + projectPart.projectPartId(), + readFileContent(QStringLiteral("/complete_target_header_unsaved.h")), + true}; }; -ClangBackEnd::ProjectPart CodeCompleter::projectPart(Utf8StringLiteral("projectPartId")); -ClangBackEnd::UnsavedFiles CodeCompleter::unsavedFiles; -ClangBackEnd::TranslationUnit CodeCompleter::translationUnit(Utf8StringLiteral(TESTDATA_DIR"/complete_completer.cpp"), unsavedFiles, projectPart); -ClangBackEnd::CodeCompleter CodeCompleter::completer = translationUnit; - -void CodeCompleter::SetUpTestCase() +Utf8String CodeCompleter::readFileContent(const QString &fileName) { - QFile unsavedFileContentFile(QStringLiteral(TESTDATA_DIR) + QStringLiteral("/complete_completer_unsaved.cpp")); - unsavedFileContentFile.open(QIODevice::ReadOnly); + QFile readFileContentFile(QStringLiteral(TESTDATA_DIR) + fileName); + bool hasOpened = readFileContentFile.open(QIODevice::ReadOnly | QIODevice::Text); - const Utf8String unsavedFileContent = Utf8String::fromByteArray(unsavedFileContentFile.readAll()); - const ClangBackEnd::FileContainer unsavedDataFileContainer(translationUnit.filePath(), - projectPart.projectPartId(), - unsavedFileContent, - true); + EXPECT_TRUE(hasOpened); - unsavedFiles.createOrUpdate({unsavedDataFileContainer}); + return Utf8String::fromByteArray(readFileContentFile.readAll()); } -void CodeCompleter::TearDownTestCase() +void CodeCompleter::copyTargetHeaderToTemporaryIncludeDirecory() { - translationUnit.reset(); - completer = ClangBackEnd::CodeCompleter(); + QFile::remove(targetHeaderPath); + bool hasCopied = QFile::copy(QStringLiteral(TESTDATA_DIR "/complete_target_header.h"), + targetHeaderPath); + EXPECT_TRUE(hasCopied); } +void CodeCompleter::copyChangedTargetHeaderToTemporaryIncludeDirecory() +{ + QFile::remove(targetHeaderPath); + bool hasCopied = QFile::copy(QStringLiteral(TESTDATA_DIR "/complete_target_header_changed.h"), + targetHeaderPath); + EXPECT_TRUE(hasCopied); +} + +void CodeCompleter::SetUp() +{ + EXPECT_TRUE(includeDirectory.isValid()); + + Utf8String includePath(QStringLiteral("-I") + includeDirectory.path()); + projectPart.setArguments({includePath}); + + copyTargetHeaderToTemporaryIncludeDirecory(); + + translationUnit.cxTranslationUnit(); // initialize translation unit so we check changes +} TEST_F(CodeCompleter, FunctionInUnsavedFile) { - ASSERT_THAT(completer.complete(100, 1), - AllOf(Contains(CodeCompletion(Utf8StringLiteral("functionWithArguments"), - 0, - CodeCompletion::FunctionCompletionKind)), - Contains(CodeCompletion(Utf8StringLiteral("function"), - 0, - CodeCompletion::FunctionCompletionKind)), - Contains(CodeCompletion(Utf8StringLiteral("newFunction"), - 0, - CodeCompletion::FunctionCompletionKind)), - Contains(CodeCompletion(Utf8StringLiteral("f"), - 0, - CodeCompletion::FunctionCompletionKind)), - Not(Contains(CodeCompletion(Utf8StringLiteral("otherFunction"), - 0, - CodeCompletion::FunctionCompletionKind))))); + unsavedFiles.createOrUpdate({unsavedMainFileContainer}); + + ASSERT_THAT(completer.complete(27, 1), + AllOf(Contains(IsCodeCompletion(Utf8StringLiteral("FunctionWithArguments"), + CodeCompletion::FunctionCompletionKind)), + Contains(IsCodeCompletion(Utf8StringLiteral("Function"), + CodeCompletion::FunctionCompletionKind)), + Contains(IsCodeCompletion(Utf8StringLiteral("UnsavedFunction"), + CodeCompletion::FunctionCompletionKind)), + Contains(IsCodeCompletion(Utf8StringLiteral("f"), + CodeCompletion::FunctionCompletionKind)), + Not(Contains(IsCodeCompletion(Utf8StringLiteral("SavedFunction"), + CodeCompletion::FunctionCompletionKind))))); } +TEST_F(CodeCompleter, VariableInUnsavedFile) +{ + unsavedFiles.createOrUpdate({unsavedMainFileContainer}); + + ASSERT_THAT(completer.complete(27, 1), + Contains(IsCodeCompletion(Utf8StringLiteral("VariableInUnsavedFile"), + CodeCompletion::VariableCompletionKind))); +} + +TEST_F(CodeCompleter, GlobalVariableInUnsavedFile) +{ + unsavedFiles.createOrUpdate({unsavedMainFileContainer}); + + ASSERT_THAT(completer.complete(27, 1), + Contains(IsCodeCompletion(Utf8StringLiteral("GlobalVariableInUnsavedFile"), + CodeCompletion::VariableCompletionKind))); +} TEST_F(CodeCompleter, Macro) { - ASSERT_THAT(completer.complete(100, 1), - Contains(CodeCompletion(Utf8StringLiteral("Macro"), - 0, - CodeCompletion::PreProcessorCompletionKind))); + unsavedFiles.createOrUpdate({unsavedMainFileContainer}); + + ASSERT_THAT(completer.complete(27, 1), + Contains(IsCodeCompletion(Utf8StringLiteral("Macro"), + CodeCompletion::PreProcessorCompletionKind))); } TEST_F(CodeCompleter, Keyword) { - ASSERT_THAT(completer.complete(100, 1), - Contains(CodeCompletion(Utf8StringLiteral("switch"), - 0, - CodeCompletion::KeywordCompletionKind))); + ASSERT_THAT(completer.complete(27, 1), + Contains(IsCodeCompletion(Utf8StringLiteral("switch"), + CodeCompletion::KeywordCompletionKind))); } - +TEST_F(CodeCompleter, FunctionInIncludedHeader) +{ + ASSERT_THAT(completer.complete(27, 1), + Contains(IsCodeCompletion(Utf8StringLiteral("FunctionInIncludedHeader"), + CodeCompletion::FunctionCompletionKind))); } +TEST_F(CodeCompleter, FunctionInUnsavedIncludedHeader) +{ + unsavedFiles.createOrUpdate({unsavedTargetHeaderFileContainer}); + ASSERT_THAT(completer.complete(27, 1), + Contains(IsCodeCompletion(Utf8StringLiteral("FunctionInIncludedHeaderUnsaved"), + CodeCompletion::FunctionCompletionKind))); +} + +TEST_F(CodeCompleter, FunctionInChangedIncludedHeader) +{ + copyChangedTargetHeaderToTemporaryIncludeDirecory(); + + ASSERT_THAT(completer.complete(27, 1), + Contains(IsCodeCompletion(Utf8StringLiteral("FunctionInIncludedHeaderChanged"), + CodeCompletion::FunctionCompletionKind))); +} + +TEST_F(CodeCompleter, FunctionInChangedIncludedHeaderWithUnsavedContentInMainFile) +{ + unsavedFiles.createOrUpdate({unsavedMainFileContainer}); + + copyChangedTargetHeaderToTemporaryIncludeDirecory(); + + ASSERT_THAT(completer.complete(27, 1), + Contains(IsCodeCompletion(Utf8StringLiteral("FunctionInIncludedHeaderChanged"), + CodeCompletion::FunctionCompletionKind))); +} + +} diff --git a/tests/unit/unittest/completionchunkstotextconvertertest.cpp b/tests/unit/unittest/completionchunkstotextconvertertest.cpp index ff52c90311e..4a2e2d737bd 100644 --- a/tests/unit/unittest/completionchunkstotextconvertertest.cpp +++ b/tests/unit/unittest/completionchunkstotextconvertertest.cpp @@ -81,6 +81,9 @@ protected: CodeCompletionChunk ifName{CodeCompletionChunk::TypedText, Utf8StringLiteral("if")}; CodeCompletionChunk horizontalSpace{CodeCompletionChunk::HorizontalSpace, Utf8StringLiteral(" ")}; CodeCompletionChunk optional{CodeCompletionChunk::Optional, Utf8String(), {comma, functionArgumentY, comma, functionArgumentZ}}; + CodeCompletionChunk enableIfT{CodeCompletionChunk::TypedText, Utf8StringLiteral("enable_if_t")}; + CodeCompletionChunk enableIfTCondition{CodeCompletionChunk::Placeholder, Utf8StringLiteral("_Cond")}; + CodeCompletionChunk enableIfTType{CodeCompletionChunk::Placeholder, Utf8StringLiteral("_Tp")}; }; TEST_F(CompletionChunksToTextConverter, ParseIsClearingText) @@ -117,12 +120,9 @@ TEST_F(CompletionChunksToTextConverter, ConvertFunctionWithParameters) TEST_F(CompletionChunksToTextConverter, ConvertFunctionWithOptionalParameter) { CodeCompletionChunks completionChunks({integerResultType, functionName, leftParen, functionArgumentX, optional,rightParen}); - converter.setAddResultType(true); - converter.setAddPlaceHolderText(true); - converter.parseChunks(completionChunks); - - ASSERT_THAT(converter.text(), QStringLiteral("int Function(char x, int y, int z)")); + ASSERT_THAT(Converter::convertToToolTip(completionChunks), + QStringLiteral("int Function (char x, int y, int z)")); } TEST_F(CompletionChunksToTextConverter, ConvertVariable) @@ -227,7 +227,6 @@ TEST_F(CompletionChunksToTextConverter, ElseIf) statements, verticalSpace, rightBrace}); - setupConverterForKeywords(); converter.parseChunks(completionChunks); @@ -235,6 +234,20 @@ TEST_F(CompletionChunksToTextConverter, ElseIf) ASSERT_THAT(converter.text(), QStringLiteral("else if {\n\n}")); } +TEST_F(CompletionChunksToTextConverter, EnableIfT) +{ + CodeCompletionChunks completionChunks({enableIfT, + leftAngle, + enableIfTCondition, + CodeCompletionChunk(CodeCompletionChunk::Optional, Utf8String(), {comma, enableIfTType}), + rightAngle}); + setupConverterForKeywords(); + + converter.parseChunks(completionChunks); + + ASSERT_THAT(converter.text(), QStringLiteral("enable_if_t<>")); +} + void CompletionChunksToTextConverter::setupConverterForKeywords() { converter.setAddPlaceHolderPositions(true); diff --git a/tests/unit/unittest/data/complete_completer.cpp b/tests/unit/unittest/data/complete_completer.cpp deleted file mode 100644 index a764b7adb4e..00000000000 --- a/tests/unit/unittest/data/complete_completer.cpp +++ /dev/null @@ -1,101 +0,0 @@ -void function() -{ - -} - -class Foo; -void functionWithArguments(int i, char *c, const Foo &ref) -{ - -} - -void otherFunction() -{ - -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void f() -{ - -} diff --git a/tests/unit/unittest/data/complete_completer_main.cpp b/tests/unit/unittest/data/complete_completer_main.cpp new file mode 100644 index 00000000000..877ce23d286 --- /dev/null +++ b/tests/unit/unittest/data/complete_completer_main.cpp @@ -0,0 +1,28 @@ +#include "complete_forwarding_header_1.h" + +void Function() +{ + +} + +class Foo; +void FunctionWithArguments(int i, char *c, const Foo &ref) +{ + +} + +void SavedFunction() +{ + +} + + + + + + + +void f() +{ + +} diff --git a/tests/unit/unittest/data/complete_completer_main_unsaved.cpp b/tests/unit/unittest/data/complete_completer_main_unsaved.cpp new file mode 100644 index 00000000000..38af12b8583 --- /dev/null +++ b/tests/unit/unittest/data/complete_completer_main_unsaved.cpp @@ -0,0 +1,28 @@ +#include "complete_forwarding_header_2.h" + +void Function() +{ + +} + +class Foo; +void FunctionWithArguments(int i, char *c, const Foo &ref) +{ + +} + +void UnsavedFunction() +{ + +} + +#define Macro + +int GlobalVariableInUnsavedFile; + +void f() +{ + int VariableInUnsavedFile; + + +} diff --git a/tests/unit/unittest/data/complete_completer_unsaved.cpp b/tests/unit/unittest/data/complete_completer_unsaved.cpp deleted file mode 100644 index 9ec3fed8f47..00000000000 --- a/tests/unit/unittest/data/complete_completer_unsaved.cpp +++ /dev/null @@ -1,100 +0,0 @@ -void function() -{ - -} - -class Foo; -void functionWithArguments(int i, char *c, const Foo &ref) -{ - -} - -void newFunction() -{ - -} - -#define Macro - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void f() -{ - -} diff --git a/tests/unit/unittest/data/complete_forwarding_header_1.h b/tests/unit/unittest/data/complete_forwarding_header_1.h new file mode 100644 index 00000000000..4905abf3e87 --- /dev/null +++ b/tests/unit/unittest/data/complete_forwarding_header_1.h @@ -0,0 +1,6 @@ +#ifndef COMPLETE_FORWARDING_HEADER_1_H +#define COMPLETE_FORWARDING_HEADER_1_H + +#include + +#endif // COMPLETE_FORWARDING_HEADER_1_H diff --git a/tests/unit/unittest/data/complete_forwarding_header_2.h b/tests/unit/unittest/data/complete_forwarding_header_2.h new file mode 100644 index 00000000000..dd0c3bc2912 --- /dev/null +++ b/tests/unit/unittest/data/complete_forwarding_header_2.h @@ -0,0 +1,7 @@ +#ifndef COMPLETE_FORWARDING_HEADER_2_H +#define COMPLETE_FORWARDING_HEADER_2_H + +#include + +#endif // COMPLETE_FORWARDING_HEADER_2_H + diff --git a/tests/unit/unittest/data/complete_target_header.h b/tests/unit/unittest/data/complete_target_header.h new file mode 100644 index 00000000000..7d0ba1c8455 --- /dev/null +++ b/tests/unit/unittest/data/complete_target_header.h @@ -0,0 +1,7 @@ +#ifndef COMPLETE_TARGET_HEADER_H +#define COMPLETE_TARGET_HEADER_H + +void FunctionInIncludedHeader(); + +#endif // COMPLETE_TARGET_HEADER_H + diff --git a/tests/unit/unittest/data/complete_target_header_changed.h b/tests/unit/unittest/data/complete_target_header_changed.h new file mode 100644 index 00000000000..d631afd91b7 --- /dev/null +++ b/tests/unit/unittest/data/complete_target_header_changed.h @@ -0,0 +1,8 @@ +#ifndef COMPLETE_TARGET_HEADER_CHANGED_H +#define COMPLETE_TARGET_HEADER_CHANGED_H + +void FunctionInIncludedHeader(); +void FunctionInIncludedHeaderChanged(); + +#endif // COMPLETE_TARGET_HEADER_CHANGED_H + diff --git a/tests/unit/unittest/data/complete_target_header_unsaved.h b/tests/unit/unittest/data/complete_target_header_unsaved.h new file mode 100644 index 00000000000..904a861870e --- /dev/null +++ b/tests/unit/unittest/data/complete_target_header_unsaved.h @@ -0,0 +1,8 @@ +#ifndef COMPLETE_TARGET_HEADER_UNSAVED_H +#define COMPLETE_TARGET_HEADER_UNSAVED_H + +void FunctionInIncludedHeader(); +void FunctionInIncludedHeaderUnsaved(); + +#endif // COMPLETE_TARGET_HEADER_UNSAVED_H +