summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qfileinfo
diff options
context:
space:
mode:
authorMarko Kangas <marko.kangas@theqtcompany.com>2015-02-13 13:01:57 +0200
committerMarko Kangas <marko.kangas@theqtcompany.com>2015-03-16 09:34:15 +0000
commitbc69fd1dfe30876909091d93a07640a498a24c0c (patch)
tree6af7b94832fcd5c596e54338266d43772ca152e6 /tests/auto/corelib/io/qfileinfo
parentf1b3244ac16cd5b306450c53fcbd4ee673bfe53b (diff)
Skip instead of entirely excluding tests with disabled features
Properly QSKIP tests that use disabled QProcess and symlink features instead of excluding them silently by #ifdef. Other reason is that moc doesn't respect QT_NO_* defines in class definition which causes build issues on some platforms. Change-Id: I041020f7452f7d36c7ec8a5866a4ba5eb23d1f94 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Jason McDonald <macadder1@gmail.com>
Diffstat (limited to 'tests/auto/corelib/io/qfileinfo')
-rw-r--r--tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
index 05546eb2b7..62e183f619 100644
--- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
+++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
@@ -219,10 +219,8 @@ private slots:
void fileTimes();
void fileTimes_oldFile();
-#ifndef Q_NO_SYMLINKS
void isSymLink_data();
void isSymLink();
-#endif
void isHidden_data();
void isHidden();
@@ -1206,9 +1204,9 @@ void tst_QFileInfo::fileTimes_oldFile()
#endif
}
-#ifndef Q_NO_SYMLINKS
void tst_QFileInfo::isSymLink_data()
{
+#ifndef Q_NO_SYMLINKS
QFile::remove("link.lnk");
QFile::remove("brokenlink.lnk");
QFile::remove("dummyfile");
@@ -1228,10 +1226,14 @@ void tst_QFileInfo::isSymLink_data()
QTest::newRow("existent file") << m_sourceFile << false << "";
QTest::newRow("link") << "link.lnk" << true << QFileInfo(m_sourceFile).absoluteFilePath();
QTest::newRow("broken link") << "brokenlink.lnk" << true << QFileInfo("dummyfile").absoluteFilePath();
+#endif
}
void tst_QFileInfo::isSymLink()
{
+#ifdef Q_NO_SYMLINKS
+ QSKIP("No symlink support", SkipAll);
+#else
QFETCH(QString, path);
QFETCH(bool, isSymLink);
QFETCH(QString, linkTarget);
@@ -1239,8 +1241,8 @@ void tst_QFileInfo::isSymLink()
QFileInfo fi(path);
QCOMPARE(fi.isSymLink(), isSymLink);
QCOMPARE(fi.symLinkTarget(), linkTarget);
-}
#endif
+}
void tst_QFileInfo::isHidden_data()
{