From b31ca9a3c3f91998c4c8e566e92ee1cb88015a9a Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Sat, 25 May 2024 19:03:08 +0930 Subject: [PATCH] Enable pdf-structure test Fedora 40 contains a recent version of poppler that supports extracting the pdf structure. And add missing pdf-structure ref data. --- .gitlab-ci.yml | 3 ++- test/pdf-structure.c | 2 +- test/reference/pdf-structure-group2.ref.txt | 4 ++++ test/reference/pdf-structure-group3.ref.txt | 6 ++++++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 test/reference/pdf-structure-group2.ref.txt create mode 100644 test/reference/pdf-structure-group3.ref.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 569aecfc9..0ff91612d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ workflow: variables: FDO_UPSTREAM_REPO: 'cairo/cairo' FDO_DISTRIBUTION_VERSION: '40' - FDO_DISTRIBUTION_TAG: '2024-04-26.0' + FDO_DISTRIBUTION_TAG: '2024-05-25.0' # TODO: should probably get its own image at some point instead of reusing the GStreamer one # See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/.gitlab-image-tags.yml for latest @@ -95,6 +95,7 @@ fedora image: google-noto-sans-vf-fonts fonttools util-linux + poppler-utils .build fedora: extends: diff --git a/test/pdf-structure.c b/test/pdf-structure.c index 3ade6de8c..a9125d2b7 100644 --- a/test/pdf-structure.c +++ b/test/pdf-structure.c @@ -554,7 +554,7 @@ check_pdf (cairo_test_context_t *ctx, const struct pdf_structure_test *test, con if (WEXITSTATUS (ret) == 0) result = CAIRO_TEST_SUCCESS; else if (WEXITSTATUS (ret) == 4) - result = CAIRO_TEST_UNTESTED; /* pdfinfo not found, wrong version, missing ref */ + result = CAIRO_TEST_UNTESTED; /* pdfinfo not found or wrong version */ } free (command); diff --git a/test/reference/pdf-structure-group2.ref.txt b/test/reference/pdf-structure-group2.ref.txt new file mode 100644 index 000000000..f15c0bc24 --- /dev/null +++ b/test/reference/pdf-structure-group2.ref.txt @@ -0,0 +1,4 @@ +H (block) + "Heading" +P (block) + "Para1" diff --git a/test/reference/pdf-structure-group3.ref.txt b/test/reference/pdf-structure-group3.ref.txt new file mode 100644 index 000000000..9db4d26d2 --- /dev/null +++ b/test/reference/pdf-structure-group3.ref.txt @@ -0,0 +1,6 @@ +Document + H (block) + "Heading" + P (block) + "Para1" + "text"