From c67634afa045b9b1e54c85942c14982ac68678e7 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Tue, 19 Dec 2023 18:28:36 -0500 Subject: Fix tests when running comparison tool is adequate Fix all tests where the only required fix is to run qpdf-test-compare instead of doing a simple file comparison. --- examples/CMakeLists.txt | 1 + examples/qtest/c-objects.test | 4 ++-- examples/qtest/custom-filter.test | 8 ++++---- examples/qtest/invert-images.test | 4 ++-- examples/qtest/overlay-page.test | 8 ++++---- examples/qtest/qpdfjob-remove-annotations.test | 4 ++-- examples/qtest/set-form-values.test | 4 ++-- 7 files changed, 17 insertions(+), 16 deletions(-) (limited to 'examples') diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 614047d5..6c1ca0f3 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -45,6 +45,7 @@ add_test( --top ${qpdf_SOURCE_DIR} --bin $ --bin $ + --bin $ --bin $ # for Windows to find DLL --code ${qpdf_SOURCE_DIR}/examples --color ${QTEST_COLOR} diff --git a/examples/qtest/c-objects.test b/examples/qtest/c-objects.test index 9cd496f6..f10f60c7 100644 --- a/examples/qtest/c-objects.test +++ b/examples/qtest/c-objects.test @@ -17,8 +17,8 @@ foreach my $i (qw(1 2)) {$td->COMMAND => "pdf-c-objects $i.pdf '' a.pdf"}, {$td->STRING => "", $td->EXIT_STATUS => 0}); $td->runtest("check output", - {$td->FILE => "a.pdf"}, - {$td->FILE => "$i-out.pdf"}); + {$td->COMMAND => "qpdf-test-compare a.pdf $i-out.pdf"}, + {$td->FILE => "$i-out.pdf", $td->EXIT_STATUS => 0}); } cleanup(); diff --git a/examples/qtest/custom-filter.test b/examples/qtest/custom-filter.test index e674ea66..2d8acec6 100644 --- a/examples/qtest/custom-filter.test +++ b/examples/qtest/custom-filter.test @@ -24,8 +24,8 @@ $td->runtest("custom filter, decode generalized", $td->EXIT_STATUS => 0}, $td->NORMALIZE_NEWLINES); $td->runtest("check output", - {$td->FILE => "a.pdf"}, - {$td->FILE => "generalized.pdf"}); + {$td->COMMAND => "qpdf-test-compare a.pdf generalized.pdf"}, + {$td->FILE => "generalized.pdf", $td->EXIT_STATUS => 0}); $td->runtest("custom filter, decode specialized", {$td->COMMAND => @@ -34,8 +34,8 @@ $td->runtest("custom filter, decode specialized", $td->EXIT_STATUS => 0}, $td->NORMALIZE_NEWLINES); $td->runtest("check output", - {$td->FILE => "a.pdf"}, - {$td->FILE => "specialized.pdf"}); + {$td->COMMAND => "qpdf-test-compare a.pdf specialized.pdf"}, + {$td->FILE => "specialized.pdf", $td->EXIT_STATUS => 0}); cleanup(); diff --git a/examples/qtest/invert-images.test b/examples/qtest/invert-images.test index d1e3c939..7986d0fd 100644 --- a/examples/qtest/invert-images.test +++ b/examples/qtest/invert-images.test @@ -20,8 +20,8 @@ $td->runtest("invert images", $td->NORMALIZE_NEWLINES); $td->runtest("check output", - {$td->FILE => "a.pdf"}, - {$td->FILE => "out.pdf"}); + {$td->COMMAND => "qpdf-test-compare a.pdf out.pdf"}, + {$td->FILE => "out.pdf", $td->EXIT_STATUS => 0}); cleanup(); diff --git a/examples/qtest/overlay-page.test b/examples/qtest/overlay-page.test index be9bcb10..6440a367 100644 --- a/examples/qtest/overlay-page.test +++ b/examples/qtest/overlay-page.test @@ -15,15 +15,15 @@ $td->runtest("overlay-page", {$td->COMMAND => "pdf-overlay-page in.pdf stamp.pdf a.pdf"}, {$td->STRING => "", $td->EXIT_STATUS => 0}); $td->runtest("compare files", - {$td->FILE => "a.pdf"}, - {$td->FILE => "out.pdf"}); + {$td->COMMAND => "qpdf-test-compare a.pdf out.pdf"}, + {$td->FILE => "out.pdf", $td->EXIT_STATUS => 0}); $td->runtest("overlay-page with fields/ annotations", {$td->COMMAND => "pdf-overlay-page in.pdf annotations.pdf a.pdf"}, {$td->STRING => "", $td->EXIT_STATUS => 0}); $td->runtest("compare files", - {$td->FILE => "a.pdf"}, - {$td->FILE => "annotations-out.pdf"}); + {$td->COMMAND => "qpdf-test-compare a.pdf annotations-out.pdf"}, + {$td->FILE => "annotations-out.pdf", $td->EXIT_STATUS => 0}); cleanup(); diff --git a/examples/qtest/qpdfjob-remove-annotations.test b/examples/qtest/qpdfjob-remove-annotations.test index 32abf3ef..06f8f07a 100644 --- a/examples/qtest/qpdfjob-remove-annotations.test +++ b/examples/qtest/qpdfjob-remove-annotations.test @@ -15,8 +15,8 @@ $td->runtest("remove-annotations", {$td->COMMAND => "qpdfjob-remove-annotations --static-id annotations.pdf out.pdf"}, {$td->STRING => "", $td->EXIT_STATUS => 0}); $td->runtest("compare files", - {$td->FILE => "out.pdf"}, - {$td->FILE => "annotations-out.pdf"}); + {$td->COMMAND => "qpdf-test-compare out.pdf annotations-out.pdf"}, + {$td->FILE => "annotations-out.pdf", $td->EXIT_STATUS => 0}); cleanup(); diff --git a/examples/qtest/set-form-values.test b/examples/qtest/set-form-values.test index 8c103379..8d2fd2c8 100644 --- a/examples/qtest/set-form-values.test +++ b/examples/qtest/set-form-values.test @@ -15,8 +15,8 @@ $td->runtest("set form values", {$td->COMMAND => "pdf-set-form-values form-in.pdf a.pdf soup"}, {$td->STRING => "", $td->EXIT_STATUS => 0}); $td->runtest("compare files", - {$td->FILE => "a.pdf"}, - {$td->FILE => "form-out.pdf"}); + {$td->COMMAND => "qpdf-test-compare a.pdf form-out.pdf"}, + {$td->FILE => "form-out.pdf", $td->EXIT_STATUS => 0}); cleanup(); -- cgit v1.2.3-54-g00ecf