diff options
author | Alex Richardson <arichardson.kde@gmail.com> | 2014-02-19 08:00:10 +0100 |
---|---|---|
committer | Alex Richardson <arichardson.kde@gmail.com> | 2014-02-19 08:00:10 +0100 |
commit | 9e3d22c3f549b583eb60c958dd923bf7c5bf4586 (patch) | |
tree | 34d3de67d4a1d281f639b2164f79045b8492a89d /autotests/kconfig_compiler/kconfigcompiler_test.cpp | |
parent | 445ca7d9549712b63fb36b8bc866544e16749e21 (diff) | |
download | kconfig-9e3d22c3f549b583eb60c958dd923bf7c5bf4586.tar.gz kconfig-9e3d22c3f549b583eb60c958dd923bf7c5bf4586.tar.bz2 |
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
Diffstat (limited to 'autotests/kconfig_compiler/kconfigcompiler_test.cpp')
-rw-r--r-- | autotests/kconfig_compiler/kconfigcompiler_test.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
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; } } |