AutoTest: Fix enabled state of framework root

Do not evaluate the invisible root as it is not a
real test tree item.

Change-Id: I944c1ac2f8ed3ff47cd8036ebf8fd8319e05e1ab
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2020-03-05 09:47:02 +01:00
parent 9abd96e38f
commit 5db38c5937

View File

@@ -337,6 +337,9 @@ bool BoostTestTreeItem::enabled() const
if (m_state & Disabled) if (m_state & Disabled)
return false; return false;
if (type() == Root)
return true;
const TestTreeItem *parent = parentItem(); const TestTreeItem *parent = parentItem();
if (parent && parent->type() == TestSuite) // take test suites into account if (parent && parent->type() == TestSuite) // take test suites into account
return static_cast<const BoostTestTreeItem *>(parent)->enabled(); return static_cast<const BoostTestTreeItem *>(parent)->enabled();