From 2b5f7316ac1b2533d0ab6b2cc348e38e7d130a9e Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 11 Mar 2021 09:51:52 +0100 Subject: [PATCH] Tests: Work around problems in execution of dumper tests On several machines the QDir test interferes in a not yet known way and makes all following tests fail. Moving it to the end makes the problem vanish. Change-Id: Ic8e7fdaaf9581be0cdd5666c7d2f12a2e8ed80ee Reviewed-by: hjk --- tests/auto/debugger/tst_dumpers.cpp | 60 +++++++++++++++-------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 64fd5636661..8cf610bd281 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -2303,35 +2303,6 @@ void tst_Dumpers::dumper_data() // Value5("Tue Jan 1 13:15:32 1980 GMT"), "@QDateTime") % Optional(); -#ifdef Q_OS_WIN - QString tempDir = "C:/Program Files"; -#else - QString tempDir = "/tmp"; -#endif - auto quoted = [](const QString &str) { return QString('"' + str + '"'); }; - - QTest::newRow("QDir") - << Data("#include \n", - - "QDir dir(" + quoted(tempDir) + ");\n" - "QString s = dir.absolutePath();\n" - "QFileInfoList fil = dir.entryInfoList();\n" - "QFileInfo fi = fil.first();", - - "&dir, &s, &fi") - - + CoreProfile() - + QtVersion(0x50300) - - + Check("dir", quoted(tempDir), "@QDir") - // + Check("dir.canonicalPath", quoted(tempDir), "@QString") - + Check("dir.absolutePath", quoted(tempDir), "@QString") % Optional() - + Check("dir.entryInfoList.0", "[0]", quoted(tempDir + "/."), "@QFileInfo") % NoCdbEngine - + Check("dir.entryInfoList.1", "[1]", quoted(tempDir + "/.."), "@QFileInfo") % NoCdbEngine - + Check("dir.entryList.0", "[0]", "\".\"", "@QString") % NoCdbEngine - + Check("dir.entryList.1", "[1]", "\"..\"", "@QString") % NoCdbEngine; - - QTest::newRow("QFileInfo") #ifdef Q_OS_WIN << Data("#include \n" @@ -8176,6 +8147,37 @@ void tst_Dumpers::dumper_data() + Check("x.2", "[2]", "3", "NI"); #endif #endif + + +/* FIXME for unknown reasons the following test must be the last one to not interfere with the + dumper tests and make all following fail */ +#ifdef Q_OS_WIN + QString tempDir = "C:/Program Files"; +#else + QString tempDir = "/tmp"; +#endif + auto quoted = [](const QString &str) { return QString('"' + str + '"'); }; + + QTest::newRow("QDir") + << Data("#include \n", + + "QDir dir(" + quoted(tempDir) + ");\n" + "QString s = dir.absolutePath();\n" + "QFileInfoList fil = dir.entryInfoList();\n" + "QFileInfo fi = fil.first();", + + "&dir, &s, &fi") + + + CoreProfile() + + QtVersion(0x50300) + + + Check("dir", quoted(tempDir), "@QDir") + // + Check("dir.canonicalPath", quoted(tempDir), "@QString") + + Check("dir.absolutePath", quoted(tempDir), "@QString") % Optional() + + Check("dir.entryInfoList.0", "[0]", quoted(tempDir + "/."), "@QFileInfo") % NoCdbEngine + + Check("dir.entryInfoList.1", "[1]", quoted(tempDir + "/.."), "@QFileInfo") % NoCdbEngine + + Check("dir.entryList.0", "[0]", "\".\"", "@QString") % NoCdbEngine + + Check("dir.entryList.1", "[1]", "\"..\"", "@QString") % NoCdbEngine; } int main(int argc, char *argv[])