mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-10 18:24:40 +00:00
173b944ef8
This makes it a lot easier to run parts of the test suite.
43 lines
1.2 KiB
Perl
43 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('tokenizer');
|
|
|
|
my $n_tests = 4;
|
|
|
|
$td->runtest("tokenizer with no ignorable",
|
|
{$td->COMMAND => "test_tokenizer -no-ignorable tokens.pdf"},
|
|
{$td->FILE => "tokens-no-ignorable.out", $td->EXIT_STATUS => 0},
|
|
$td->NORMALIZE_NEWLINES);
|
|
|
|
$td->runtest("tokenizer",
|
|
{$td->COMMAND => "test_tokenizer tokens.pdf"},
|
|
{$td->FILE => "tokens.out", $td->EXIT_STATUS => 0},
|
|
$td->NORMALIZE_NEWLINES);
|
|
|
|
$td->runtest("tokenizer with max_len",
|
|
{$td->COMMAND => "test_tokenizer -maxlen 50 tokens.pdf"},
|
|
{$td->FILE => "tokens-maxlen.out", $td->EXIT_STATUS => 0},
|
|
$td->NORMALIZE_NEWLINES);
|
|
|
|
$td->runtest("ignore bad token",
|
|
{$td->COMMAND =>
|
|
"qpdf --show-xref bad-token-startxref.pdf"},
|
|
{$td->FILE => "bad-token-startxref.out",
|
|
$td->EXIT_STATUS => 0},
|
|
$td->NORMALIZE_NEWLINES);
|
|
|
|
cleanup();
|
|
$td->report($n_tests);
|