summaryrefslogtreecommitdiffstats
path: root/tests/auto/selftests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/selftests')
-rw-r--r--tests/auto/selftests/badxml/tst_badxml.cpp7
-rw-r--r--tests/auto/selftests/tst_selftests.cpp63
2 files changed, 42 insertions, 28 deletions
diff --git a/tests/auto/selftests/badxml/tst_badxml.cpp b/tests/auto/selftests/badxml/tst_badxml.cpp
index 6b2e4c4..fa5b717 100644
--- a/tests/auto/selftests/badxml/tst_badxml.cpp
+++ b/tests/auto/selftests/badxml/tst_badxml.cpp
@@ -58,6 +58,8 @@ private slots:
void badMessage() const;
void badMessage_data() const;
+ void failWithNoFile() const;
+
public:
static QList<QByteArray> const& badStrings();
};
@@ -116,6 +118,11 @@ void tst_BadXml::badDataTag_data() const
}
}
+void tst_BadXml::failWithNoFile() const
+{
+ QTest::qFail("failure message", 0, 0);
+}
+
/*
Outputs a message containing a bad string.
*/
diff --git a/tests/auto/selftests/tst_selftests.cpp b/tests/auto/selftests/tst_selftests.cpp
index aa1048b..d4069b1 100644
--- a/tests/auto/selftests/tst_selftests.cpp
+++ b/tests/auto/selftests/tst_selftests.cpp
@@ -324,34 +324,41 @@ void tst_Selftests::checkXML() const
if(m_checkXMLBlacklist.contains(subdir))
return;
- arguments.prepend("-xml");
- arguments.prepend("-flush");
-
- QProcess proc;
- proc.setEnvironment(QStringList(""));
- proc.start(subdir + "/" + subdir, arguments);
- QVERIFY(proc.waitForFinished());
-
- QByteArray out(proc.readAllStandardOutput());
- QByteArray err(proc.readAllStandardError());
-
- /* Some platforms decides to output a message for uncaught exceptions. For instance,
- * this is what windows platforms says:
- * "This application has requested the Runtime to terminate it in an unusual way.
- * Please contact the application's support team for more information." */
- if(subdir != QLatin1String("exception") && subdir != QLatin1String("fetchbogus"))
- QVERIFY2(err.isEmpty(), err.constData());
-
- QXmlStreamReader reader(out);
-
- while(!reader.atEnd())
- reader.readNext();
-
- QVERIFY2(!reader.error(), qPrintable(QString("line %1, col %2: %3")
- .arg(reader.lineNumber())
- .arg(reader.columnNumber())
- .arg(reader.errorString())
- ));
+ QStringList args;
+ /* Test both old (-flush) and new XML logger implementation */
+ for (int i = 0; i < 2; ++i) {
+ bool flush = i;
+ args = arguments;
+ args.prepend("-xml");
+ if (flush) args.prepend("-flush");
+
+ QProcess proc;
+ proc.setEnvironment(QStringList(""));
+ proc.start(subdir + "/" + subdir, args);
+ QVERIFY(proc.waitForFinished());
+
+ QByteArray out(proc.readAllStandardOutput());
+ QByteArray err(proc.readAllStandardError());
+
+ /* Some platforms decides to output a message for uncaught exceptions. For instance,
+ * this is what windows platforms says:
+ * "This application has requested the Runtime to terminate it in an unusual way.
+ * Please contact the application's support team for more information." */
+ if(subdir != QLatin1String("exception") && subdir != QLatin1String("fetchbogus"))
+ QVERIFY2(err.isEmpty(), err.constData());
+
+ QXmlStreamReader reader(out);
+
+ while(!reader.atEnd())
+ reader.readNext();
+
+ QVERIFY2(!reader.error(), qPrintable(QString("(flush %0) line %1, col %2: %3")
+ .arg(flush)
+ .arg(reader.lineNumber())
+ .arg(reader.columnNumber())
+ .arg(reader.errorString())
+ ));
+ }
}
void tst_Selftests::checkXunitxml() const