summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/mimetypes
diff options
context:
space:
mode:
authorAndrew Knight <andrew.knight@digia.com>2013-09-02 21:00:14 +0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-03 08:42:24 +0200
commitcd582f841076010dac334427830763838c0996b8 (patch)
tree42cf3aa63d8f9c4ce15c960788e4b973cb436048 /tests/auto/corelib/mimetypes
parent5bd6a4b71a5eeb88ccc2f0fd1515deeeb92e1b53 (diff)
Add QT_NO_PROCESS guards in tests where they are missing
A handful of tests lack QT_NO_PROCESS guards, making them non-compilable on Qt builds with no QProcess support. This commit does not change QProcess-specific tests, which should be left out of the build using the .pro file mechanism. Change-Id: Iac8562428abc1f59ccbb23bf5c3a919785e41f12 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'tests/auto/corelib/mimetypes')
-rw-r--r--tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
index 07d3c5c7b8..258f167a20 100644
--- a/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
+++ b/tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
@@ -766,6 +766,7 @@ void tst_QMimeDatabase::fromThreads()
// sync dtor blocks waiting for finished
}
+#ifndef QT_NO_PROCESS
static bool runUpdateMimeDatabase(const QString &path) // TODO make it a QMimeDatabase method?
{
const QString umdCommand = QString::fromLatin1("update-mime-database");
@@ -799,6 +800,7 @@ static bool waitAndRunUpdateMimeDatabase(const QString &path)
}
return runUpdateMimeDatabase(path);
}
+#endif // !QT_NO_PROCESS
static void checkHasMimeType(const QString &mimeType)
{
@@ -821,6 +823,9 @@ QT_END_NAMESPACE
void tst_QMimeDatabase::installNewGlobalMimeType()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("This test requires QProcess support");
+#else
qmime_secondsBetweenChecks = 0;
QMimeDatabase db;
@@ -862,10 +867,14 @@ void tst_QMimeDatabase::installNewGlobalMimeType()
QCOMPARE(db.mimeTypeForFile(QLatin1String("foo.ymu"), QMimeDatabase::MatchExtension).name(),
QString::fromLatin1("application/octet-stream"));
QVERIFY(!db.mimeTypeForName(QLatin1String("text/x-suse-ymp")).isValid());
+#endif // !QT_NO_PROCESS
}
void tst_QMimeDatabase::installNewLocalMimeType()
{
+#ifdef QT_NO_PROCESS
+ QSKIP("This test requires QProcess support");
+#else
qmime_secondsBetweenChecks = 0;
QMimeDatabase db;
@@ -913,6 +922,7 @@ void tst_QMimeDatabase::installNewLocalMimeType()
QCOMPARE(db.mimeTypeForFile(QLatin1String("foo.ymu"), QMimeDatabase::MatchExtension).name(),
QString::fromLatin1("application/octet-stream"));
QVERIFY(!db.mimeTypeForName(QLatin1String("text/x-suse-ymp")).isValid());
+#endif
}
QTEST_GUILESS_MAIN(tst_QMimeDatabase)