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

Improve failure diagnostic for pkpass extractor test

Same as the universal extractor test, makes it much easier to review
changes and update the reference data.
parent dbac6368
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <QFile> #include <QFile>
#include <QJsonArray> #include <QJsonArray>
#include <QJsonDocument> #include <QJsonDocument>
#include <QProcess>
#include <QObject> #include <QObject>
#include <QTest> #include <QTest>
...@@ -78,8 +79,17 @@ private Q_SLOTS: ...@@ -78,8 +79,17 @@ private Q_SLOTS:
QCOMPARE(doc.array().size(), result.size()); QCOMPARE(doc.array().size(), result.size());
if (resJson != doc.array()) { if (resJson != doc.array()) {
qDebug().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, doc.array()); QCOMPARE(resJson, doc.array());
} }
}; };
......
Markdown is supported
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