AutoTest: Prefer ITestParser to ITestFramework in TestCodeParser

Preserves the level of abstraction.

Change-Id: I01354fc8fcdf846dd2ef2a20fce12f6e9c4756b2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Bernhard Beschow
2021-01-01 19:19:33 +01:00
parent 2674e9c62e
commit c16f8ce988
3 changed files with 29 additions and 37 deletions

View File

@@ -43,8 +43,6 @@ namespace ProjectExplorer { class Project; }
namespace Autotest {
class ITestFramework;
namespace Internal {
class TestCodeParser : public QObject
@@ -64,7 +62,7 @@ public:
State state() const { return m_parserState; }
bool isParsing() const { return m_parserState == PartialParse || m_parserState == FullParse; }
void setDirty() { m_dirty = true; }
void syncTestFrameworks(const QList<ITestFramework *> &frameworks);
void syncTestFrameworks(const QList<ITestParser *> &parsers);
#ifdef WITH_TESTS
bool furtherParsingExpected() const
{ return m_singleShotScheduled || m_fullUpdatePostponed || m_partialUpdatePostponed; }
@@ -81,7 +79,7 @@ signals:
public:
void emitUpdateTestTree(ITestParser *parser = nullptr);
void updateTestTree(const QSet<ITestFramework *> &frameworks = {});
void updateTestTree(const QSet<ITestParser *> &parsers = {});
void onCppDocumentUpdated(const CPlusPlus::Document::Ptr &document);
void onQmlDocumentUpdated(const QmlJS::Document::Ptr &document);
void onStartupProjectChanged(ProjectExplorer::Project *project);
@@ -91,7 +89,7 @@ public:
private:
bool postponed(const QStringList &fileList);
void scanForTests(const QStringList &fileList = QStringList(),
const QList<ITestFramework *> &parserIds = {});
const QList<ITestParser *> &parsers = {});
// qml files must be handled slightly different
void onDocumentUpdated(const QString &fileName, bool isQmlFile = false);
@@ -117,7 +115,7 @@ private:
QFutureWatcher<TestParseResultPtr> m_futureWatcher;
QList<ITestParser *> m_testCodeParsers; // ptrs are still owned by TestFrameworkManager
QTimer m_reparseTimer;
QSet<ITestFramework *> m_updateParsers;
QSet<ITestParser *> m_updateParsers;
QThreadPool *m_threadPool = nullptr;
};