diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-02-01 15:58:32 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-02-01 19:50:58 +0100 |
commit | a0d9d9923ce397d46680a9b180f253b39135ece2 (patch) | |
tree | e32ad4accca1ba83780b35cf74d6e2de6f2335d7 /examples/qtest | |
parent | b02d37bc0ae0b7af6077637f855be8579c768c22 (diff) | |
download | qpdf-a0d9d9923ce397d46680a9b180f253b39135ece2.tar.zst |
Finish QPDFJob examples and add tests for them
Diffstat (limited to 'examples/qtest')
-rw-r--r-- | examples/qtest/qpdf-job.test | 32 | ||||
-rw-r--r-- | examples/qtest/qpdf-job/in.pdf | 78 | ||||
-rw-r--r-- | examples/qtest/qpdf-job/out | 3 | ||||
-rw-r--r-- | examples/qtest/qpdf-job/out.pdf | bin | 0 -> 1300 bytes | |||
-rw-r--r-- | examples/qtest/qpdfjob-c.test | 29 | ||||
-rw-r--r-- | examples/qtest/qpdfjob-c/in.pdf | 78 | ||||
-rw-r--r-- | examples/qtest/qpdfjob-c/out.pdf | bin | 0 -> 1300 bytes |
7 files changed, 220 insertions, 0 deletions
diff --git a/examples/qtest/qpdf-job.test b/examples/qtest/qpdf-job.test new file mode 100644 index 00000000..d3a490ab --- /dev/null +++ b/examples/qtest/qpdf-job.test @@ -0,0 +1,32 @@ +#!/usr/bin/env perl +require 5.008; +use warnings; +use strict; + +chdir("qpdf-job") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +cleanup(); + +my $td = new TestDriver('qpdf-job'); + +$td->runtest("qpdf-job", + {$td->COMMAND => "qpdf-job"}, + {$td->FILE => "out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +for (my $i = 1; $i <= 3; ++$i) +{ + $td->runtest("check output $i", + {$td->FILE => "out$i.pdf"}, + {$td->FILE => "out.pdf"}); +} + +cleanup(); + +$td->report(4); + +sub cleanup +{ + unlink "out1.pdf", "out2.pdf", "out3.pdf"; +} diff --git a/examples/qtest/qpdf-job/in.pdf b/examples/qtest/qpdf-job/in.pdf new file mode 100644 index 00000000..37457117 --- /dev/null +++ b/examples/qtest/qpdf-job/in.pdf @@ -0,0 +1,78 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R +>> +startxref +544 +%%EOF diff --git a/examples/qtest/qpdf-job/out b/examples/qtest/qpdf-job/out new file mode 100644 index 00000000..e4d55650 --- /dev/null +++ b/examples/qtest/qpdf-job/out @@ -0,0 +1,3 @@ +out1 status: 0 +out2 status: 0 +out3 status: 0 diff --git a/examples/qtest/qpdf-job/out.pdf b/examples/qtest/qpdf-job/out.pdf Binary files differnew file mode 100644 index 00000000..c432ac59 --- /dev/null +++ b/examples/qtest/qpdf-job/out.pdf diff --git a/examples/qtest/qpdfjob-c.test b/examples/qtest/qpdfjob-c.test new file mode 100644 index 00000000..33a55431 --- /dev/null +++ b/examples/qtest/qpdfjob-c.test @@ -0,0 +1,29 @@ +#!/usr/bin/env perl +require 5.008; +use warnings; +use strict; + +chdir("qpdf-job") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +cleanup(); + +my $td = new TestDriver('qpdfjob-c'); + +$td->runtest("qpdfjob-c", + {$td->COMMAND => "qpdfjob-c in.pdf a.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.pdf"}, + {$td->FILE => "out.pdf"}); + +cleanup(); + +$td->report(2); + +sub cleanup +{ + unlink "a.pdf"; +} diff --git a/examples/qtest/qpdfjob-c/in.pdf b/examples/qtest/qpdfjob-c/in.pdf new file mode 100644 index 00000000..37457117 --- /dev/null +++ b/examples/qtest/qpdfjob-c/in.pdf @@ -0,0 +1,78 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R +>> +startxref +544 +%%EOF diff --git a/examples/qtest/qpdfjob-c/out.pdf b/examples/qtest/qpdfjob-c/out.pdf Binary files differnew file mode 100644 index 00000000..c432ac59 --- /dev/null +++ b/examples/qtest/qpdfjob-c/out.pdf |