summaryrefslogtreecommitdiffstats
path: root/tests/auto/selftests/tst_selftests.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-09-06 10:49:40 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-09-06 10:55:40 +0200
commita6b6e760ac2f019b9ca42847b9535207966811aa (patch)
treecdba2823eb3708f7a40593ff69b81d2be88515ea /tests/auto/selftests/tst_selftests.cpp
parent48ba459580c9e4ce28dbb2c3ce433175148da5a1 (diff)
parent8ed47d961dc7e6f161030654d11cd330a542eadf (diff)
Merge remote branch 'gerrit/master' into HEAD
Conflicts: configure.exe src/corelib/global/qglobal.h src/gui/kernel/qplatformnativeinterface_qpa.h src/gui/widgets/qlinecontrol.cpp src/gui/widgets/qmenu_mac.mm src/gui/widgets/qmenu_p.h src/gui/widgets/qmenubar.cpp src/gui/widgets/qmenubar_p.h src/gui/widgets/widgets.pri src/plugins/platforms/wayland/qwaylandnativeinterface.cpp src/plugins/platforms/wayland/qwaylandnativeinterface.h src/src.pro tests/auto/qdir/tst_qdir.cpp tests/auto/qfileinfo/tst_qfileinfo.cpp tests/auto/qsslsocket/tst_qsslsocket.cpp tests/auto/qstring/tst_qstring.cpp Change-Id: I64cf2cefa532ba87a92f632e3595ce6914183e9b
Diffstat (limited to 'tests/auto/selftests/tst_selftests.cpp')
-rw-r--r--tests/auto/selftests/tst_selftests.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/tests/auto/selftests/tst_selftests.cpp b/tests/auto/selftests/tst_selftests.cpp
index 78f0620779..138e47927f 100644
--- a/tests/auto/selftests/tst_selftests.cpp
+++ b/tests/auto/selftests/tst_selftests.cpp
@@ -173,11 +173,10 @@ Logger::Logger(QString const& _name, QString const& _testdata_suffix, QStringLis
static QList<Logger> allLoggers()
{
return QList<Logger>()
- << Logger("plain", "txt", QStringList())
- << Logger("xml", "xml", QStringList() << "-xml")
- << Logger("xml flush", "xml", QStringList() << "-xml" << "-flush")
- << Logger("xunitxml", "xunitxml", QStringList() << "-xunitxml")
- << Logger("lightxml", "lightxml", QStringList() << "-lightxml")
+ << Logger("plain", "txt", QStringList())
+ << Logger("xml", "xml", QStringList() << "-xml")
+ << Logger("xunitxml", "xunitxml", QStringList() << "-xunitxml")
+ << Logger("lightxml", "lightxml", QStringList() << "-lightxml")
;
}
@@ -415,12 +414,16 @@ void tst_Selftests::doRunSubTest(QString const& subdir, QString const& logger, Q
const QString output(QString::fromLatin1(line));
const QString expected(QString::fromLatin1(exp.at(i)).replace("@INSERT_QT_VERSION_HERE@", QT_VERSION_STR));
+ // Q_ASSERT uses __FILE__. Some compilers include the absolute path in
+ // __FILE__, while others do not.
if (line.contains("ASSERT") && output != expected) {
- QEXPECT_FAIL("assert", "QTestLib prints out the absolute path.", Continue);
- QEXPECT_FAIL("assert xml", "QTestLib prints out the absolute path.", Continue);
- QEXPECT_FAIL("assert xml flush","QTestLib prints out the absolute path.", Continue);
- QEXPECT_FAIL("assert lightxml", "QTestLib prints out the absolute path.", Continue);
- QEXPECT_FAIL("assert xunitxml", "QTestLib prints out the absolute path.", Continue);
+ const char msg[] = "Q_ASSERT prints out the absolute path on this platform.";
+ QEXPECT_FAIL("assert", msg, Continue);
+ QEXPECT_FAIL("assert xml", msg, Continue);
+ QEXPECT_FAIL("assert xml flush", msg, Continue);
+ QEXPECT_FAIL("assert lightxml", msg, Continue);
+ QEXPECT_FAIL("assert lightxml flush", msg, Continue);
+ QEXPECT_FAIL("assert xunitxml", msg, Continue);
}
/* On some platforms we compile without RTTI, and as a result we never throw an exception. */