Merge remote-tracking branch 'origin/4.6'

Conflicts:
	tests/unit/unittest/gtest-creator-printing.cpp
	tests/unit/unittest/gtest-creator-printing.h

Change-Id: I43d2571617bfbf41c0fcf23502ab77975540eba4
This commit is contained in:
Eike Ziller
2018-01-17 09:30:57 +01:00
113 changed files with 3769 additions and 434 deletions

View File

@@ -271,6 +271,13 @@ static QtTestCodeLocationList tagLocationsFor(const QtTestParseResult *func,
return QtTestCodeLocationList();
}
static bool isQObject(const CPlusPlus::Document::Ptr &declaringDoc)
{
const QString file = declaringDoc->fileName();
return (Utils::HostOsInfo::isMacHost() && file.endsWith("QtCore.framework/Headers/qobject.h"))
|| file.endsWith("QtCore/qobject.h") || file.endsWith("kernel/qobject.h");
}
static bool handleQtTest(QFutureInterface<TestParseResultPtr> futureInterface,
CPlusPlus::Document::Ptr document,
const CPlusPlus::Snapshot &snapshot,
@@ -303,6 +310,10 @@ static bool handleQtTest(QFutureInterface<TestParseResultPtr> futureInterface,
fetchAndMergeBaseTestFunctions(
visitor.baseClasses(), testFunctions, declaringDoc, snapshot);
// handle tests that are not runnable without more information (plugin unit test of QC)
if (testFunctions.isEmpty() && testCaseName == "QObject" && isQObject(declaringDoc))
return true; // we did not handle it, but we do not expect any test defined there either
const QSet<QString> &files = filesWithDataFunctionDefinitions(testFunctions);
// TODO: change to QHash<>