aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-10-08 22:10:15 +0200
committerJay Berkenbilt <ejb@ql.org>2022-10-08 22:10:15 +0200
commitb745920961bd44cbe3ded956c7b79f47c142b118 (patch)
treeee78b60f0669cd9cf5dc7c852fcbe47d496647ed
parent5c5b4e640e2df248192ff7aa518fb0d345884a33 (diff)
downloadqpdf-b745920961bd44cbe3ded956c7b79f47c142b118.tar.zst
Allow specific performance tests to be run
-rw-r--r--ChangeLog5
-rwxr-xr-xperformance_check20
2 files changed, 24 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 96a096a8..70cf457c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* Change minimum required C++ version from C++-14 to C++-17.
diff --git a/performance_check b/performance_check
index 60ba58a6..ac04d168 100755
--- a/performance_check
+++ b/performance_check
@@ -50,7 +50,7 @@ my $default_iterations = 20;
sub usage
{
- die "
+ warn "
Usage: $whoami [ args ]
--dir dir test on all files in dir (default: $default_test_dir)
--file file test only on the named file
@@ -58,15 +58,23 @@ Usage: $whoami [ args ]
--workdir where to write output pdfs (default: $default_workdir)
--maxtime maximum time for a test; 0 means unlimited (default: $default_maxtime)
--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
benchmarking. PDF files and qpdf JSON files are allowed. The qpdf
release process uses a clone of
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)
{
my $arg = shift(@ARGV);
@@ -102,6 +110,11 @@ while (@ARGV)
usage() unless @ARGV;
$iterations = shift(@ARGV);
}
+ elsif ('--test' eq $arg)
+ {
+ usage() unless @ARGV;
+ $test_re = shift(@ARGV);
+ }
else
{
usage();
@@ -233,6 +246,11 @@ sub run_tests
foreach my $test (@tests)
{
my ($name, $args) = @$test;
+ if ((defined $test_re) && $name !~ m/$test_re/)
+ {
+ print " skipping test $name\n";
+ next;
+ }
print " test: $name\n";
$args = filter_args($args);
if (! defined $args)