summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2024-03-21 01:08:51 +0200
committerAhmad Samir <a.samirh78@gmail.com>2024-03-21 06:26:28 +0200
commitd34a9067c27750f4936a623825010a4efca8307c (patch)
tree8e7ae4ea49faebe9ab0f2ee770b3cdecec5337fb
parent56ef55eda0b197e975de155815885f310dc2e661 (diff)
tst_qdir: optimize setPath() test
On Linux "../" is /tmp, which is more likely to cause issues with the dir.entrylist() below used in that test; /tmp could have a lot of temporary files, any of them can be gone in a jiffy. Noticed this test occasionally falking out when running tests in parallel (`ctest -R "foo|bar" -j3`). This may be an unintentional side effect of b3e9e80719f5a69c8f28f6eceaadbbdd7f1f5fe5, which changed the code to use a temporary dir for testing instead of creating/deleting dirs in the source dir ("../" from the source dir has a more stable entries count than /tmp). Change-Id: I98da86223792bc9f34c173fc02cc84049ed699ae Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--tests/auto/corelib/io/qdir/tst_qdir.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp
index 895f6e0998..77b3eee0f1 100644
--- a/tests/auto/corelib/io/qdir/tst_qdir.cpp
+++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp
@@ -341,6 +341,7 @@ void tst_QDir::setPath()
QFETCH(QString, dir1);
QFETCH(QString, dir2);
+ QDir::setCurrent(m_dataPath + "/entrylist"_L1);
QDir shared;
QDir qDir1(dir1);
QStringList entries1 = qDir1.entryList();