2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-05 20:00:53 +00:00
qpdf/qpdf/qtest/collate.test
Jay Berkenbilt 173b944ef8 Split qpdf.test into multiple test suites
This makes it a lot easier to run parts of the test suite.
2022-05-14 17:35:06 -04:00

47 lines
1.2 KiB
Perl

#!/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('collate');
my @collate = (
["", "three-files", "collate-odd",
"collate-odd.pdf 1-5 minimal.pdf collate-even.pdf 7-1"],
[1, "three-files", "collate-odd",
"collate-odd.pdf 1-5 minimal.pdf collate-even.pdf 7-1"],
[2, "three-files-2", "collate-odd",
"collate-odd.pdf 1-5 minimal.pdf collate-even.pdf 7-1"],
);
my $n_tests = 2 * scalar(@collate);
foreach my $d (@collate)
{
my ($n, $description, $first, $args) = @$d;
my $collate = '--collate';
if ($n)
{
$collate .= "=$n";
}
$td->runtest("collate pages: $description",
{$td->COMMAND =>
"qpdf --qdf --static-id $collate $first.pdf" .
" --pages $args -- a.pdf"},
{$td->STRING => "", $td->EXIT_STATUS => 0});
$td->runtest("check output",
{$td->FILE => "a.pdf"},
{$td->FILE => "$description-collate-out.pdf"});
}
cleanup();
$td->report($n_tests);