From 5f8c2ce63499d05dfb4753eb1acc21dccf21d434 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 17 Jan 2020 10:03:43 +0000 Subject: Revert "WIP: Refactor KConfigXT" This reverts commit 98c32e29f50465d4d4e16bafdf0491edbfb422b0. This broke kdevelop and kmymoney. I'm workin on the fixes and more unittests for them. --- .../kconfig_compiler/kconfigcompiler_test.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'autotests/kconfig_compiler/kconfigcompiler_test.cpp') 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; } } -- cgit v1.2.1