From 555a6b5d5d2dd91a0dcf9e3d5fbadd1b31bf80f3 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 26 Sep 2018 08:56:36 +0200 Subject: Modernize the "filesystemwatcher" feature Change-Id: If030b56ad97e047d89d442629262b4839df306d4 Reviewed-by: Edward Welbourne Reviewed-by: Ulf Hermann --- tests/auto/corelib/io/io.pro | 3 +++ tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp | 6 ------ tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/io/io.pro b/tests/auto/corelib/io/io.pro index 5eab944fe4..3c93fd5e1f 100644 --- a/tests/auto/corelib/io/io.pro +++ b/tests/auto/corelib/io/io.pro @@ -55,6 +55,9 @@ SUBDIRS=\ win32:!qtConfig(private_tests): SUBDIRS -= \ qfilesystementry +!qtConfig(filesystemwatcher): SUBDIRS -= \ + qfilesystemwatcher + !qtConfig(processenvironment): SUBDIRS -= \ qprocessenvironment diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index 72cad92edb..67ffa91e57 100644 --- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -45,7 +45,6 @@ class tst_QFileSystemWatcher : public QObject public: tst_QFileSystemWatcher(); -#ifndef QT_NO_FILESYSTEMWATCHER private slots: void basicTest_data(); void basicTest(); @@ -77,24 +76,20 @@ private slots: private: QString m_tempDirPattern; -#endif // QT_NO_FILESYSTEMWATCHER }; tst_QFileSystemWatcher::tst_QFileSystemWatcher() { -#ifndef QT_NO_FILESYSTEMWATCHER m_tempDirPattern = QDir::tempPath(); if (!m_tempDirPattern.endsWith(QLatin1Char('/'))) m_tempDirPattern += QLatin1Char('/'); m_tempDirPattern += QStringLiteral("tst_qfilesystemwatcherXXXXXX"); -#endif // QT_NO_FILESYSTEMWATCHER #if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) QDir::setCurrent(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)); #endif } -#ifndef QT_NO_FILESYSTEMWATCHER void tst_QFileSystemWatcher::basicTest_data() { QTest::addColumn("backend"); @@ -805,7 +800,6 @@ void tst_QFileSystemWatcher::watchUnicodeCharacters() QVERIFY(testDir.mkdir("creme")); QTRY_COMPARE(changedSpy.count(), 1); } -#endif // QT_NO_FILESYSTEMWATCHER QTEST_MAIN(tst_QFileSystemWatcher) #include "tst_qfilesystemwatcher.moc" diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 5301dababc..bd4dc3d6f3 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -2259,7 +2259,7 @@ Q_GLOBAL_STATIC(QLocale, tst_qapp_locale); #if QT_CONFIG(process) Q_GLOBAL_STATIC(QProcess, tst_qapp_process); #endif -#ifndef QT_NO_FILESYSTEMWATCHER +#if QT_CONFIG(filesystemwatcher) Q_GLOBAL_STATIC(QFileSystemWatcher, tst_qapp_fileSystemWatcher); #endif #ifndef QT_NO_SHAREDMEMORY @@ -2284,7 +2284,7 @@ void tst_QApplication::globalStaticObjectDestruction() #if QT_CONFIG(process) QVERIFY(tst_qapp_process()); #endif -#ifndef QT_NO_FILESYSTEMWATCHER +#if QT_CONFIG(filesystemwatcher) QVERIFY(tst_qapp_fileSystemWatcher()); #endif #ifndef QT_NO_SHAREDMEMORY -- cgit v1.2.3