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 | |
| 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
| -rw-r--r-- | autotests/kconfig_compiler/kconfigcompiler_test.cpp | 14 | ||||
| -rw-r--r-- | autotests/kconfig_compiler/kconfigcompiler_test.h | 1 | 
2 files changed, 3 insertions, 12 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;      }  } diff --git a/autotests/kconfig_compiler/kconfigcompiler_test.h b/autotests/kconfig_compiler/kconfigcompiler_test.h index 940044a8..3777eaa7 100644 --- a/autotests/kconfig_compiler/kconfigcompiler_test.h +++ b/autotests/kconfig_compiler/kconfigcompiler_test.h @@ -35,7 +35,6 @@ private:      void appendFileDiff(const QString &oldFile, const QString &newFile);      QString m_diffExe; -    QFile m_diff;  };  #endif | 
