From 9e3d22c3f549b583eb60c958dd923bf7c5bf4586 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Wed, 19 Feb 2014 08:00:10 +0100 Subject: Print the diff to stdout on comparison failure Previously the output of diff -u was written to a file when the generated file did not match the expectations. Having the output printed to stdout makes it easier to see the exact error without having to know that a diff exists in a certain file somewhere in the build directory. REVIEW: 115832 --- autotests/kconfig_compiler/kconfigcompiler_test.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 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 48192f5e..fcefcb68 100644 --- a/autotests/kconfig_compiler/kconfigcompiler_test.cpp +++ b/autotests/kconfig_compiler/kconfigcompiler_test.cpp @@ -78,11 +78,8 @@ static CompilerTestSet willFailCases = { void KConfigCompiler_Test::initTestCase() { m_diffExe = QStandardPaths::findExecutable("diff"); - if (!m_diffExe.isEmpty()) { - m_diff.setFileName(QDir::currentPath() + QLatin1String("/kconfigcompiler_test_differences.diff")); - if (m_diff.exists()) { - m_diff.remove(); - } + if (m_diffExe.isEmpty()) { + qDebug() << "diff command not found, detailed info on comparison failure will not be available."; } } @@ -155,11 +152,6 @@ void KConfigCompiler_Test::appendFileDiff(const QString &oldFile, const QString if (m_diffExe.isEmpty()) { return; } - if (!m_diff.isOpen()) { - if (!m_diff.open(QIODevice::WriteOnly)) { - return; - } - } QStringList args; args << "-u"; @@ -172,6 +164,6 @@ void KConfigCompiler_Test::appendFileDiff(const QString &oldFile, const QString process.waitForFinished(); if (process.exitCode() == 1) { QByteArray out = process.readAllStandardOutput(); - m_diff.write(out); + qDebug() << '\n' << out; } } -- cgit v1.2.1