2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-04 03:10:52 +00:00

Allow specific performance tests to be run

This commit is contained in:
Jay Berkenbilt 2022-10-08 16:10:15 -04:00
parent 5c5b4e640e
commit b745920961
2 changed files with 24 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2022-10-08 Jay Berkenbilt <ejb@ql.org>
* performance_check: add --test option to limit which tests are
run.
2022-10-06 Jay Berkenbilt <ejb@ql.org> 2022-10-06 Jay Berkenbilt <ejb@ql.org>
* Change minimum required C++ version from C++-14 to C++-17. * Change minimum required C++ version from C++-14 to C++-17.

View File

@ -50,7 +50,7 @@ my $default_iterations = 20;
sub usage sub usage
{ {
die " warn "
Usage: $whoami [ args ] Usage: $whoami [ args ]
--dir dir test on all files in dir (default: $default_test_dir) --dir dir test on all files in dir (default: $default_test_dir)
--file file test only on the named file --file file test only on the named file
@ -58,15 +58,23 @@ Usage: $whoami [ args ]
--workdir where to write output pdfs (default: $default_workdir) --workdir where to write output pdfs (default: $default_workdir)
--maxtime maximum time for a test; 0 means unlimited (default: $default_maxtime) --maxtime maximum time for a test; 0 means unlimited (default: $default_maxtime)
--iterations number of iterations (default: $default_iterations) --iterations number of iterations (default: $default_iterations)
--test regexp run only tests that match specified pattern
Populate $test_dir with files you want to use for performance Populate $test_dir with files you want to use for performance
benchmarking. PDF files and qpdf JSON files are allowed. The qpdf benchmarking. PDF files and qpdf JSON files are allowed. The qpdf
release process uses a clone of release process uses a clone of
https://github.com/qpdf/performance-test-files for this purpose. https://github.com/qpdf/performance-test-files for this purpose.
Tests:
"; ";
foreach my $t (@tests)
{
warn " $t->[0]\n";
}
exit 2;
} }
my $test_re = undef;
while (@ARGV) while (@ARGV)
{ {
my $arg = shift(@ARGV); my $arg = shift(@ARGV);
@ -102,6 +110,11 @@ while (@ARGV)
usage() unless @ARGV; usage() unless @ARGV;
$iterations = shift(@ARGV); $iterations = shift(@ARGV);
} }
elsif ('--test' eq $arg)
{
usage() unless @ARGV;
$test_re = shift(@ARGV);
}
else else
{ {
usage(); usage();
@ -233,6 +246,11 @@ sub run_tests
foreach my $test (@tests) foreach my $test (@tests)
{ {
my ($name, $args) = @$test; my ($name, $args) = @$test;
if ((defined $test_re) && $name !~ m/$test_re/)
{
print " skipping test $name\n";
next;
}
print " test: $name\n"; print " test: $name\n";
$args = filter_args($args); $args = filter_args($args);
if (! defined $args) if (! defined $args)