Commit c852af2a570e67dfe6a275f4d3866191fec36829
1 parent
d34ab8a9
Add tests for progress and verbose changes
Showing
3 changed files
with
41 additions
and
2 deletions
qpdf/qtest/qpdf.test
| ... | ... | @@ -1235,8 +1235,10 @@ my $pages_options = "--pages page-labels-and-outlines.pdf 1,3,5-7,z" . |
| 1235 | 1235 | |
| 1236 | 1236 | $td->runtest("merge three files", |
| 1237 | 1237 | {$td->COMMAND => "qpdf page-labels-and-outlines.pdf a.pdf" . |
| 1238 | - " $pages_options --static-id"}, | |
| 1239 | - {$td->STRING => "", $td->EXIT_STATUS => 0}); | |
| 1238 | + " $pages_options --static-id --verbose --progress", | |
| 1239 | + $td->FILTER => "perl filter-progress.pl"}, | |
| 1240 | + {$td->FILE => "verbose-merge.out", $td->EXIT_STATUS => 0}, | |
| 1241 | + $td->NORMALIZE_NEWLINES); | |
| 1240 | 1242 | # Manually verified about this file: make sure that outline entries |
| 1241 | 1243 | # that pointed to pages that were preserved still work in the copy, |
| 1242 | 1244 | # and verify that all pages are as expected. page-labels-and-outlines | ... | ... |
qpdf/qtest/qpdf/filter-progress.pl
0 → 100644
| 1 | +use strict; | |
| 2 | +use warnings; | |
| 3 | + | |
| 4 | +my $seen = 0; | |
| 5 | +while (<>) | |
| 6 | +{ | |
| 7 | + if (m/write progress: (?:10)?0\%/) | |
| 8 | + { | |
| 9 | + print; | |
| 10 | + } | |
| 11 | + elsif (m/write progress: /) | |
| 12 | + { | |
| 13 | + if (! $seen) | |
| 14 | + { | |
| 15 | + $seen = 1; | |
| 16 | + print "....other write progress....\n"; | |
| 17 | + } | |
| 18 | + } | |
| 19 | + else | |
| 20 | + { | |
| 21 | + print; | |
| 22 | + } | |
| 23 | +} | ... | ... |
qpdf/qtest/qpdf/verbose-merge.out
0 → 100644
| 1 | +qpdf: processing 20-pages.pdf | |
| 2 | +qpdf: processing ./20-pages.pdf | |
| 3 | +qpdf: processing minimal.pdf | |
| 4 | +qpdf: removing unreferenced pages from primary input | |
| 5 | +qpdf: adding pages from page-labels-and-outlines.pdf | |
| 6 | +qpdf: adding pages from 20-pages.pdf | |
| 7 | +qpdf: adding pages from page-labels-and-outlines.pdf | |
| 8 | +qpdf: adding pages from 20-pages.pdf | |
| 9 | +qpdf: adding pages from ./20-pages.pdf | |
| 10 | +qpdf: adding pages from minimal.pdf | |
| 11 | +qpdf: a.pdf: write progress: 0% | |
| 12 | +....other write progress.... | |
| 13 | +qpdf: a.pdf: write progress: 100% | |
| 14 | +qpdf: wrote file a.pdf | ... | ... |