AutoTest: Add option to disable derived checks

Previously the quick test parser would always check each symbol
its interested in to see if it might be derived from "TestCase".
This is very expensive.

This patch adds an option allowing the user to
enable or disable the check.

By default the check is disabled.

Change-Id: Ia6b230b344add672e53ad7fb52845c78a2914b99
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-01-18 08:15:08 +01:00
parent 978639b995
commit 3873bcf2a4
8 changed files with 57 additions and 8 deletions

View File

@@ -4,8 +4,11 @@
#include "autotestunittests.h"
#include "testcodeparser.h"
#include "testframeworkmanager.h"
#include "testtreemodel.h"
#include "qtest/qttestsettings.h"
#include <cppeditor/cppmodelmanager.h>
#include <cppeditor/cpptoolstestcase.h>
#include <cppeditor/projectinfo.h>
@@ -72,6 +75,12 @@ void AutoTestUnitTests::initTestCase()
m_checkBoost = true;
}
}
// Enable quick check for derived tests
static const Utils::Id id = Utils::Id("AutoTest.Framework.QtTest");
static_cast<Autotest::Internal::QtTestSettings *>(
TestFrameworkManager::frameworkForId(id)->testSettings())
->quickCheckForDerivedTests.setValue(true);
}
void AutoTestUnitTests::cleanupTestCase()