Commit 07000748 authored by Heiko Becker's avatar Heiko Becker
Browse files

Fix tests without Poppler

parent 892361a4
Pipeline #151853 skipped
......@@ -54,6 +54,9 @@ private Q_SLOTS:
QFile f(QStringLiteral(SOURCE_DIR "/misc/test.pdf"));
QVERIFY(f.open(QFile::ReadOnly));
#ifndef HAVE_POPPLER
QSKIP("No Poppler support");
#endif
auto root = engine.documentNodeFactory()->createNode(f.readAll());
QVERIFY(!root.isNull());
QCOMPARE(root.mimeType(), QLatin1String("application/pdf"));
......@@ -94,6 +97,9 @@ private Q_SLOTS:
QFile f(QStringLiteral(SOURCE_DIR "/misc/test.pdf"));
QVERIFY(f.open(QFile::ReadOnly));
#ifndef HAVE_POPPLER
QSKIP("No Poppler support");
#endif
std::unique_ptr<PdfDocument> pdf(PdfDocument::fromData(f.readAll()));
auto root = engine.documentNodeFactory()->createNode(QVariant::fromValue(pdf.get()), u"application/pdf");
QVERIFY(!root.isNull());
......
......@@ -129,6 +129,9 @@ private Q_SLOTS:
QFile f(s(SOURCE_DIR "/extractordata/synthetic/iata-bcbp-demo.pdf"));
QVERIFY(f.open(QFile::ReadOnly));
#ifndef HAVE_POPPLER
QSKIP("No Poppler support");
#endif
ExtractorEngine engine;
engine.setData(f.readAll());
engine.extract();
......
......@@ -54,11 +54,13 @@ private Q_SLOTS:
QTest::newRow("text/plain") << s(SOURCE_DIR "/scriptenginedata/plain-text.txt") << s(SOURCE_DIR "/scriptenginedata/plain-text.txt.json");
QTest::newRow("pkpass") << s(SOURCE_DIR "/pkpassdata/swiss.pkpass") << s(SOURCE_DIR "/scriptenginedata/swiss.pkpass.json");
#ifdef HAVE_POPPLER
QTest::newRow("IATA BCBP PDF") << s(SOURCE_DIR "/extractordata/synthetic/iata-bcbp-demo.pdf")
#ifdef HAVE_ZXING
<< s(SOURCE_DIR "/scriptenginedata/iata-bcbp-demo.pdf.json");
#else
<< s(SOURCE_DIR "/scriptenginedata/iata-bcbp-demo.pdf-no-zxing.json");
#endif
#endif
QTest::newRow("ical") << s(SOURCE_DIR "/extractordata/ical/eventreservation.ics") << s(SOURCE_DIR "/scriptenginedata/eventreservation.ics.json");
QTest::newRow("uic9183") << s(SOURCE_DIR "/uic918-3/valid/Testw_VOW8XG6_A9E8DXL_0.bin") << s(SOURCE_DIR "/scriptenginedata/Testw_VOW8XG6_A9E8DXL_0.bin.json");
......
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