diff options
Diffstat (limited to 'autotests/kconfig_compiler/kconfigcompiler_test.cpp')
-rw-r--r-- | autotests/kconfig_compiler/kconfigcompiler_test.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/autotests/kconfig_compiler/kconfigcompiler_test.cpp b/autotests/kconfig_compiler/kconfigcompiler_test.cpp index 7ab4a923..383745b1 100644 --- a/autotests/kconfig_compiler/kconfigcompiler_test.cpp +++ b/autotests/kconfig_compiler/kconfigcompiler_test.cpp @@ -125,7 +125,9 @@ void KConfigCompiler_Test::testBaselineComparison() if (content != contentRef) { appendFileDiff(fileRef.fileName(), file.fileName()); } - + // use split('\n') to avoid + // the whole output shown inline + QCOMPARE(content.split('\n'), contentRef.split('\n')); QVERIFY(content == contentRef); } @@ -164,23 +166,17 @@ void KConfigCompiler_Test::appendFileDiff(const QString &oldFile, const QString return; } - QStringList args({ - QStringLiteral("-u"), - QFileInfo(oldFile).absoluteFilePath(), - QFileInfo(newFile).absoluteFilePath() }); + QStringList args; + args << QStringLiteral("-u"); + args << QFileInfo(oldFile).absoluteFilePath(); + args << QFileInfo(newFile).absoluteFilePath(); QProcess process; process.start(m_diffExe, args, QIODevice::ReadOnly); process.waitForStarted(); process.waitForFinished(); - if (process.exitCode() == 1) { - const QString diffFileName = oldFile + QStringLiteral(".diff"); - QFile diffFile(diffFileName); - QVERIFY2(diffFile.open(QIODevice::WriteOnly), qPrintable(QLatin1String("Could not save diff file for ") + oldFile)); - diffFile.write(process.readAllStandardOutput()); - - // force a failure to print the flename where we stored the diff. - QVERIFY2(false, qPrintable(QLatin1String("This test failed, look at the following file for details: ") + diffFileName)); + QByteArray out = process.readAllStandardOutput(); + qDebug() << '\n' << out; } } |