forked from qt-creator/qt-creator
		
	CppTools: Remove test file after test
In test_includeGroups_detectIncludeGroupsByIncludeType the test file was not removed and thus subsequent and isolated executions of this test failed. Change-Id: I5eeb4f004f5b146ac794ca913b4092629131fca3 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
		| @@ -64,17 +64,16 @@ public: | ||||
|     Document::Ptr run(const QByteArray &source) | ||||
|     { | ||||
|         const QString fileName = TestIncludePaths::testFilePath(); | ||||
|         if (QFileInfo(fileName).exists()) | ||||
|             return Document::Ptr(); // Test file was not removed. | ||||
|  | ||||
|         TestCase::writeFile(fileName, source); | ||||
|         FileWriterAndRemover scopedFile(fileName, source); | ||||
|         if (!scopedFile.writtenSuccessfully()) | ||||
|             return Document::Ptr(); | ||||
|  | ||||
|         CppSourceProcessor sourceProcessor((QPointer<CppModelManager>(m_cmm))); | ||||
|         sourceProcessor.setIncludePaths(QStringList(TestIncludePaths::directoryOfTestFile())); | ||||
|         sourceProcessor.run(fileName); | ||||
|  | ||||
|         Document::Ptr document = m_cmm->document(fileName); | ||||
|         QFile(fileName).remove(); | ||||
|         return document; | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user