diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2014-04-14 15:40:30 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2014-04-15 14:18:27 +0200 |
commit | fdc392858716c390f1541430dad3bb6aefdf792e (patch) | |
tree | daece0e70b9525ab45718ac9fd2019a215aecc71 /tests/auto/blackbox | |
parent | a27e8552174475e95cb5ec42612c41e25bcd1364 (diff) |
Work around braindead QFileInfo::exists() behavior for symbolic links.
Change-Id: If8002fc7be0cc6af954ebb28ccbcb7bee1031e1c
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'tests/auto/blackbox')
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index d4ff742cb..50ec294f7 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -468,6 +468,11 @@ void TestBlackbox::resolve_project_dry_run() QVERIFY2(!QFile::exists(buildGraphPath), qPrintable(buildGraphPath)); } +static bool symlinkExists(const QString &linkFilePath) +{ + return QFileInfo(linkFilePath).isSymLink(); +} + void TestBlackbox::clean() { const QString appObjectFilePath = buildDir + "/.obj/app/main.cpp" + QTC_HOST_OBJECT_SUFFIX; @@ -506,7 +511,7 @@ void TestBlackbox::clean() QVERIFY(!QFile(depObjectFilePath).exists()); QVERIFY(QFile(depLibFilePath).exists()); foreach (const QString &symLink, symlinks) - QVERIFY2(QFile(symLink).exists(), qPrintable(symLink)); + QVERIFY2(symlinkExists(symLink), qPrintable(symLink)); // Remove all. QCOMPARE(runQbs(), 0); @@ -518,7 +523,7 @@ void TestBlackbox::clean() QVERIFY(!QFile(depObjectFilePath).exists()); QVERIFY(!QFile(depLibFilePath).exists()); foreach (const QString &symLink, symlinks) - QVERIFY2(!QFile(symLink).exists(), qPrintable(symLink)); + QVERIFY2(!symlinkExists(symLink), qPrintable(symLink)); // Dry run. QCOMPARE(runQbs(), 0); @@ -531,7 +536,7 @@ void TestBlackbox::clean() QVERIFY(QFile(depObjectFilePath).exists()); QVERIFY(QFile(depLibFilePath).exists()); foreach (const QString &symLink, symlinks) - QVERIFY2(QFile(symLink).exists(), qPrintable(symLink)); + QVERIFY2(symlinkExists(symLink), qPrintable(symLink)); // Product-wise, dependency only. QCOMPARE(runQbs(), 0); @@ -547,7 +552,7 @@ void TestBlackbox::clean() QVERIFY(!QFile(depObjectFilePath).exists()); QVERIFY(!QFile(depLibFilePath).exists()); foreach (const QString &symLink, symlinks) - QVERIFY2(!QFile(symLink).exists(), qPrintable(symLink)); + QVERIFY2(!symlinkExists(symLink), qPrintable(symLink)); // Product-wise, dependent product only. QCOMPARE(runQbs(), 0); @@ -563,7 +568,7 @@ void TestBlackbox::clean() QVERIFY(QFile(depObjectFilePath).exists()); QVERIFY(QFile(depLibFilePath).exists()); foreach (const QString &symLink, symlinks) - QVERIFY2(QFile(symLink).exists(), qPrintable(symLink)); + QVERIFY2(symlinkExists(symLink), qPrintable(symLink)); } void TestBlackbox::exportSimple() |