diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-05-14 22:16:20 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-05-14 23:35:06 +0200 |
commit | 173b944ef8f1dd3f971a6089a52fcd1ae07ca8f1 (patch) | |
tree | ad6f8c53b76b6975ddb8abe1cdc64d7677d58aee /qpdf/qtest/basic_parsing.test | |
parent | 4b642caf1114f6a354c21444d1fdccba3cb894b9 (diff) | |
download | qpdf-173b944ef8f1dd3f971a6089a52fcd1ae07ca8f1.tar.zst |
Split qpdf.test into multiple test suites
This makes it a lot easier to run parts of the test suite.
Diffstat (limited to 'qpdf/qtest/basic_parsing.test')
-rw-r--r-- | qpdf/qtest/basic_parsing.test | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/qpdf/qtest/basic_parsing.test b/qpdf/qtest/basic_parsing.test new file mode 100644 index 00000000..d150ba9e --- /dev/null +++ b/qpdf/qtest/basic_parsing.test @@ -0,0 +1,77 @@ +#!/usr/bin/env perl +require 5.008; +use warnings; +use strict; + +unshift(@INC, '.'); +require qpdf_test_helpers; + +chdir("qpdf") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +cleanup(); + +my $td = new TestDriver('basic_parsing'); + +my @goodfiles = ("implicit null", # 1 + "direct null", # 2 + "unresolved null", # 3 + "indirect null", # 4 + "indirect bool, real", # 5 + "direct bool", # 6 + "integer", # 7 + "real, ASCIIHexDecode", # 8 + "string", # 9 + "array", # 10 + "dictionary", # 11 + "stream", # 12 + "nesting, strings, names", # 13 + "tokenizing pipeline", # 14 + "name", # 15 + "object-stream", # 16 + "hybrid xref", # 17 + "hybrid xref old mode", # 18 + "xref with prev", # 19 + "lots of compressible objects", # 20 + "array with indirect nulls", # 21 + ); + +my $n_tests = (3 * @goodfiles) + 6; + +my %goodtest_overrides = ('14' => 3); +my %goodtest_flags = + ('18' => '-ignore-xref-streams', + '20' => '-object-streams=generate', + ); +for (my $i = 1; $i <= scalar(@goodfiles); ++$i) +{ + my $n = $goodtest_overrides{$i} || 1; + $td->runtest("$goodfiles[$i-1]", + {$td->COMMAND => "test_driver $n good$i.pdf"}, + {$td->FILE => "good$i.out", + $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + my $xflags = $goodtest_flags{$i} || ''; + check_pdf($td, "create qdf", + "qpdf --static-id -qdf $xflags good$i.pdf", + "good$i.qdf", 0); +} + +check_pdf($td, "no normalization", + "qpdf -qdf --static-id --normalize-content=n good7.pdf", + "good7-not-normalized.qdf", + 0); + +check_pdf($td, "no qdf", + "qpdf --static-id good17.pdf", + "good17-not-qdf.pdf", + 0); + +check_pdf($td, "no recompression", + "qpdf --static-id --stream-data=preserve good17.pdf", + "good17-not-recompressed.pdf", + 0); + +cleanup(); +$td->report($n_tests); |