The watchFileAndItsDirectory() test would fail due to atime updates for
the first watched file coming up to 2 seconds after the file was closed.
Observation shows that the atime has a 2 second resolution on Mac OS X
using HFS+, so add an appropriate delay to make sure that the atime
update from the kqueue based file system watcher can dispatch all
updates.
Task-number: QTBUG-22744
Change-Id: Ie79af20d6b4c154021307c8a8f6d336369720337
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
TARGET = tst_qfilesystemwatcher
QT = core testlib
SOURCES = tst_qfilesystemwatcher.cpp
-
-mac: CONFIG += insignificant_test # QTBUG-22744
testFile.write(QByteArray("hello again"));
testFile.close();
+#ifdef Q_OS_MAC
+ // wait again for the file's atime to be updated
+ QTest::qWait(2000);
+#endif
+
QTRY_VERIFY(fileChangedSpy.count() > 0);
//according to Qt 4 documentation: