AutoTest: Speed up scanning for tests

Especially Qt and Quick tests scanning takes some time,
so do some additional pre-filtering of files before
parsing them to reduce the number of files to process.
Depending on the structure of the project this can
significantly reduce the scan time.

Task-number: QTCREATORBUG-29301
Change-Id: I629beedcc02502d98d84e29282e1cd7b265cfcf0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Christian Stenger
2023-08-23 15:59:38 +02:00
parent a6e779606d
commit 322336a488
6 changed files with 54 additions and 4 deletions

View File

@@ -9,6 +9,8 @@
#include <cppeditor/cppworkingcopy.h>
#include <qmljs/qmljsdocument.h>
#include <optional>
QT_BEGIN_NAMESPACE
template <class T>
class QPromise;
@@ -76,6 +78,9 @@ public:
static bool precompiledHeaderContains(const CPlusPlus::Snapshot &snapshot,
const Utils::FilePath &filePath,
const QRegularExpression &headerFileRegex);
// returns all files of the startup project whose ProjectPart has the given \a macroName
// set as a project define
static std::optional<QSet<Utils::FilePath>> filesContainingMacro(const QByteArray &macroName);
protected:
CPlusPlus::Snapshot m_cppSnapshot;