diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2020-01-17 10:03:43 +0000 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2020-01-17 10:03:43 +0000 |
commit | 5f8c2ce63499d05dfb4753eb1acc21dccf21d434 (patch) | |
tree | fed718a3c8f4c4974411d612a79c4125ae3fffd8 /autotests/kconfig_compiler/kconfigcompiler_test.cpp | |
parent | 98c32e29f50465d4d4e16bafdf0491edbfb422b0 (diff) | |
download | kconfig-5f8c2ce63499d05dfb4753eb1acc21dccf21d434.tar.gz kconfig-5f8c2ce63499d05dfb4753eb1acc21dccf21d434.tar.bz2 |
Revert "WIP: Refactor KConfigXT"
This reverts commit 98c32e29f50465d4d4e16bafdf0491edbfb422b0.
This broke kdevelop and kmymoney. I'm workin on the fixes and more
unittests for them.
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; } } |