aboutsummaryrefslogtreecommitdiffstats
path: root/libtests/qtest/random.test
diff options
context:
space:
mode:
Diffstat (limited to 'libtests/qtest/random.test')
-rw-r--r--libtests/qtest/random.test32
1 files changed, 26 insertions, 6 deletions
diff --git a/libtests/qtest/random.test b/libtests/qtest/random.test
index c3b4b9d7..f757b4a9 100644
--- a/libtests/qtest/random.test
+++ b/libtests/qtest/random.test
@@ -7,10 +7,30 @@ require TestDriver;
my $td = new TestDriver('random');
-$td->runtest("Random Data Providers",
- {$td->COMMAND => "random"},
- {$td->STRING => "random: end of tests\n",
- $td->EXIT_STATUS => 0},
- $td->NORMALIZE_NEWLINES);
+my @providers = ();
+if (exists $ENV{'QPDF_CRYPTO_PROVIDER'})
+{
+ push(@providers, $ENV{'QPDF_CRYPTO_PROVIDER'});
+}
+else
+{
+ open(Q, "qpdf --show-crypto|") or die;
+ while (<Q>)
+ {
+ s/\s+$//s;
+ push(@providers, $_);
+ }
+ close(Q);
+}
+foreach my $p (@providers)
+{
+ $ENV{'QPDF_CRYPTO_PROVIDER'} = $p;
-$td->report(1);
+ $td->runtest("Random Data Providers ($p)",
+ {$td->COMMAND => "random"},
+ {$td->STRING => "random: end of tests\n",
+ $td->EXIT_STATUS => 0},
+ $td->NORMALIZE_NEWLINES);
+}
+
+$td->report(scalar(@providers));