Commit 2034e49c authored by Volker Krause's avatar Volker Krause
Browse files

Check if 'cat' executable exists before using it

Summary:
Should fix this test breaking (ie. hanging due to error message box) on
Windows.

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D25801
parent c40ab0f4
......@@ -90,14 +90,16 @@ void SignatureTester::testSignatures()
thisFile.open(QIODevice::ReadOnly);
QString fileContent = QString::fromUtf8(thisFile.readAll());
Signature sig3;
sig3.setPath(QStringLiteral("cat ") + KShell::quoteArg(QStringLiteral(__FILE__)), true);
QCOMPARE(sig3.rawText(), fileContent);
QVERIFY(!sig3.isInlinedHtml());
QVERIFY(sig3.text().isEmpty());
QCOMPARE(sig3.type(), Signature::FromCommand);
QCOMPARE(sig3.withSeparator(), QString(QStringLiteral("-- \n") + fileContent));
QVERIFY(!sig3.isEnabledSignature());
if (!QStandardPaths::findExecutable(QStringLiteral("cat")).isEmpty()) {
Signature sig3;
sig3.setPath(QStringLiteral("cat ") + KShell::quoteArg(QStringLiteral(__FILE__)), true);
QCOMPARE(sig3.rawText(), fileContent);
QVERIFY(!sig3.isInlinedHtml());
QVERIFY(sig3.text().isEmpty());
QCOMPARE(sig3.type(), Signature::FromCommand);
QCOMPARE(sig3.withSeparator(), QString(QStringLiteral("-- \n") + fileContent));
QVERIFY(!sig3.isEnabledSignature());
}
Signature sig4;
sig4.setPath(QStringLiteral(__FILE__), false);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment