Clang: Tests: Use global temporary dir to remove test file later

Change-Id: Ic31428db15ebbc3a4fc5d5a24723d3a557b77b58
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-07-17 11:18:42 +02:00
parent 0926d63d56
commit 95c90dcd42

View File

@@ -80,6 +80,13 @@ QString qrcPath(const QByteArray relativeFilePath)
QString fileName(const QString &filePath) QString fileName(const QString &filePath)
{ return QFileInfo(filePath).fileName(); } { return QFileInfo(filePath).fileName(); }
CppTools::Tests::TemporaryDir *globalTemporaryDir()
{
static CppTools::Tests::TemporaryDir dir;
QTC_CHECK(dir.isValid());
return &dir;
}
struct LogOutput struct LogOutput
{ {
LogOutput(const QString &text) : text(text.toUtf8()) {} LogOutput(const QString &text) : text(text.toUtf8()) {}
@@ -576,7 +583,7 @@ public:
CppTools::Tests::TestCase garbageCollectionGlobalSnapshot; CppTools::Tests::TestCase garbageCollectionGlobalSnapshot;
QVERIFY(garbageCollectionGlobalSnapshot.succeededSoFar()); QVERIFY(garbageCollectionGlobalSnapshot.succeededSoFar());
const TestDocument testDocument(testFileName); const TestDocument testDocument(testFileName, globalTemporaryDir());
QVERIFY(testDocument.isCreatedAndHasValidCursorPosition()); QVERIFY(testDocument.isCreatedAndHasValidCursorPosition());
OpenEditorAtCursorPosition openEditor(testDocument); OpenEditorAtCursorPosition openEditor(testDocument);