Commit c05035f0 authored by Volker Krause's avatar Volker Krause
Browse files

Add better diagnostics for the RCT2 parser test

parent 6762f54b
......@@ -14,6 +14,7 @@
#include <QJsonArray>
#include <QJsonDocument>
#include <QObject>
#include <QProcess>
#include <QTest>
using namespace KItinerary;
......@@ -63,6 +64,15 @@ private Q_SLOTS:
const auto resJson = JsonLdDocument::toJson(QVector<QVariant>({QVariant::fromValue(rct2)}));
if (refArray != resJson) {
qWarning().noquote() << QJsonDocument(resJson).toJson();
QFile failFile(refFile + QLatin1String(".fail"));
QVERIFY(failFile.open(QFile::WriteOnly));
failFile.write(QJsonDocument(resJson).toJson());
failFile.close();
QProcess proc;
proc.setProcessChannelMode(QProcess::ForwardedChannels);
proc.start(QStringLiteral("diff"), {QStringLiteral("-u"), refFile, failFile.fileName()});
QVERIFY(proc.waitForFinished());
}
QCOMPARE(resJson, refArray);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment