From 9d87018fcd5d66e21c52dcdb386239045f4f4fb9 Mon Sep 17 00:00:00 2001 From: Jeremy Bicha Date: Tue, 13 Dec 2022 08:53:51 -0500 Subject: [PATCH] Fix qt6 autopkgtest --- debian/tests/qt6 | 2 +- debian/tests/test-qt6.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 debian/tests/test-qt6.cpp diff --git a/debian/tests/qt6 b/debian/tests/qt6 index e7933a4..232236c 100755 --- a/debian/tests/qt6 +++ b/debian/tests/qt6 @@ -10,5 +10,5 @@ else fi cd $AUTOPKGTEST_TMP -${CROSS_COMPILE}g++ -Wall -Werror -pedantic -Wno-long-long -Wno-deprecated-declarations -fPIC -std=c++11 -o poppler-qt6-test $SRCDIR/test-qt6.cpp `${CROSS_COMPILE}pkg-config --cflags --libs poppler-qt6 qt6Core` +${CROSS_COMPILE}g++ -Wall -Werror -pedantic -Wno-long-long -Wno-deprecated-declarations -fPIC -std=c++17 -o poppler-qt6-test $SRCDIR/test-qt6.cpp `${CROSS_COMPILE}pkg-config --cflags --libs poppler-qt6 Qt6Core` ./poppler-qt6-test "/usr/share/cups/data/default-testpage.pdf" diff --git a/debian/tests/test-qt6.cpp b/debian/tests/test-qt6.cpp new file mode 100644 index 0000000..3bf09c5 --- /dev/null +++ b/debian/tests/test-qt6.cpp @@ -0,0 +1,18 @@ +#include +#include +#include + +int main(int argc, char *argv[]) +{ + if (argc < 2) + return EXIT_FAILURE; + + std::unique_ptr doc = Poppler::Document::load(QFile::decodeName(argv[1])); + Q_ASSERT(doc); + Q_ASSERT(!doc->isLocked()); + + int n_pages = doc->numPages(); + Q_ASSERT(n_pages > 0); + + return EXIT_SUCCESS; +} -- GitLab