Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 7c837113 authored by Henrik Fehlauer's avatar Henrik Fehlauer

Improve error message when parttest fails due to missing pdflatex

Summary:
`PartTest::testForwardPDF` tests whether the synctex integration works
and needs to create a PDF from latex sources via `pdflatex`.
If this is not installed the test fails, but the error message
`'started' returned FALSE` requires diving into the source code to debug
the problem.

By providing a more meaningful error message we make it easier for
developers and distributions to run all autotests sucessfully (short of
build-requiring a latex installation). Note that Albert does not want to
simply skip the tests in that case, so no optional build-time dependency
either.

Ref T7532

Test Plan:
Run `parttest testForwardPDF` w/ and w/o `pdflatex` executable
available.

Reviewers: aacid, #okular

Reviewed By: aacid, #okular

Subscribers: #okular

Tags: #okular

Maniphest Tasks: T7532

Differential Revision: https://phabricator.kde.org/D9578
parent 804bb086
......@@ -197,7 +197,12 @@ void PartTest::testForwardPDF()
QVERIFY(f.copy(texDestination));
QProcess process;
process.setWorkingDirectory(workDir.path());
process.start(QStringLiteral("pdflatex"), QStringList() << QStringLiteral("-synctex=1") << QStringLiteral("-interaction=nonstopmode") << texDestination);
const QString pdflatexPath(QStandardPaths::findExecutable("pdflatex"));
if (pdflatexPath.isEmpty()) {
QFAIL("pdflatex executable not found, but needed for the test. Try installing the respective TeXLive packages.");
}
process.start(pdflatexPath, QStringList() << QStringLiteral("-synctex=1") << QStringLiteral("-interaction=nonstopmode") << texDestination);
bool started = process.waitForStarted();
if (!started) {
qDebug() << "start error:" << process.error();
......
Markdown is supported
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