Commit cb3c7538 authored by Nikolai Kosjar's avatar Nikolai Kosjar Committed by Erik Verbruggen

CppTools: Fix flaky test_cpplocatorfilters_CppLocatorFilter

The GenericProjectManager tests left over some state in CppModelManager.

Change-Id: I3f5c5bf27b9443e6753eb6c24114e2e5b99e7372
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent b94b7b3e
......@@ -153,6 +153,8 @@ void CppToolsPlugin::test_cpplocatorfilters_CppLocatorFilter()
QFETCH(QString, searchText);
QFETCH(ResultDataList, expectedResults);
Tests::VerifyCleanCppModelManager verify;
CppLocatorFilterTestCase(filter, testFile, searchText, expectedResults);
}
......
......@@ -628,7 +628,7 @@ void CppToolsPlugin::test_modelmanager_extraeditorsupport_uiFiles()
QVERIFY(temporaryDir.isValid());
const QString projectFile = temporaryDir.absolutePath("testdata_guiproject1.pro");
ProjectOpenerAndCloser projects(/*waitForFinishedGcOnDestruction=*/ true);
ProjectOpenerAndCloser projects;
ProjectInfo projectInfo = projects.open(projectFile, /*configureAsExampleProject=*/ true);
QVERIFY(projectInfo.isValid());
......
......@@ -111,7 +111,7 @@ class CPPTOOLS_EXPORT ProjectOpenerAndCloser : public QObject
Q_OBJECT
public:
ProjectOpenerAndCloser(bool waitForFinishedGcOnDestruction = false);
ProjectOpenerAndCloser(bool waitForFinishedGcOnDestruction = true);
~ProjectOpenerAndCloser(); // Closes opened projects
ProjectInfo open(const QString &projectFile, bool configureAsExampleProject = false);
......@@ -138,7 +138,7 @@ private:
bool m_isValid;
};
class VerifyCleanCppModelManager
class CPPTOOLS_EXPORT VerifyCleanCppModelManager
{
public:
VerifyCleanCppModelManager() { verify(); }
......
......@@ -60,6 +60,8 @@ inline QString sourceProjectPath(const QString &project)
void GenericProjectPlugin::test_simple()
{
Tests::VerifyCleanCppModelManager verify;
TemporaryCopiedDir temporaryDir(sourceProjectPath(_("testdata_simpleproject")));
QVERIFY(temporaryDir.isValid());
const QString mainFile = temporaryDir.absolutePath("main.cpp");
......@@ -93,6 +95,8 @@ static QStringList simplify(const QList<CppTools::ProjectFile> &files, const QSt
void GenericProjectPlugin::test_mixed1()
{
Tests::VerifyCleanCppModelManager verify;
TemporaryCopiedDir temporaryDir(sourceProjectPath(_("testdata_mixedproject1/")));
QVERIFY(temporaryDir.isValid());
const QString projectFile = temporaryDir.absolutePath("mixedproject1.creator");
......@@ -140,6 +144,8 @@ void GenericProjectPlugin::test_mixed1()
void GenericProjectPlugin::test_mixed2()
{
Tests::VerifyCleanCppModelManager verify;
TemporaryCopiedDir temporaryDir(sourceProjectPath(_("testdata_mixedproject2/")));
QVERIFY(temporaryDir.isValid());
const QString projectFile = temporaryDir.absolutePath("mixedproject2.creator");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment