Merge remote-tracking branch 'origin/4.15'

Change-Id: Ic839ab43a723ab22cc83e5b0d823ec6121cb6701
This commit is contained in:
Eike Ziller
2021-05-10 13:50:43 +02:00
25 changed files with 190 additions and 111 deletions

View File

@@ -66,15 +66,24 @@ static bool isCatchMacro(const QString &macroName)
static bool includesCatchHeader(const CPlusPlus::Document::Ptr &doc,
const CPlusPlus::Snapshot &snapshot)
{
static const QString catchHeader("catch.hpp");
static const QStringList catchHeaders{"catch.hpp", // v2
"catch_all.hpp", // v3 - new approach
"catch_amalgamated.hpp",
"catch_test_macros.hpp",
"catch_template_test_macros.hpp"
};
for (const CPlusPlus::Document::Include &inc : doc->resolvedIncludes()) {
if (inc.resolvedFileName().endsWith(catchHeader))
return true;
for (const QString &catchHeader : catchHeaders) {
if (inc.resolvedFileName().endsWith(catchHeader))
return true;
}
}
for (const QString &include : snapshot.allIncludesForDocument(doc->fileName())) {
if (include.endsWith(catchHeader))
return true;
for (const QString &catchHeader : catchHeaders) {
if (include.endsWith(catchHeader))
return true;
}
}
return false;

View File

@@ -623,10 +623,6 @@ static Qt::CheckState computeCheckStateByChildren(ITestTreeItem *item)
bool foundPartiallyChecked = false;
item->forFirstLevelChildren([&](ITestTreeItem *child) {
if (foundPartiallyChecked || (foundChecked && foundUnchecked)) {
newState = Qt::PartiallyChecked;
return;
}
switch (child->type()) {
case TestTreeItem::TestDataFunction:
case TestTreeItem::TestSpecialFunction:
@@ -638,6 +634,11 @@ static Qt::CheckState computeCheckStateByChildren(ITestTreeItem *item)
foundChecked |= (child->checked() == Qt::Checked);
foundUnchecked |= (child->checked() == Qt::Unchecked);
foundPartiallyChecked |= (child->checked() == Qt::PartiallyChecked);
if (foundPartiallyChecked || (foundChecked && foundUnchecked)) {
newState = Qt::PartiallyChecked;
return;
}
});
if (newState != Qt::PartiallyChecked)