diff options
author | Fabian Keil <fk@fabiankeil.de> | 2014-10-09 15:48:19 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-02-09 00:28:29 +0100 |
commit | 8ad31a8c6eb3f19997d66c470defa12a4882970f (patch) | |
tree | b6835f27010bf1e56f2e84fdea8d0bcd79204d7a | |
parent | e6d55f647d0fb11fcd5b7b3de3591e2d7afc9525 (diff) | |
download | curl-8ad31a8c6eb3f19997d66c470defa12a4882970f.tar.gz |
runtests.pl: add an -o option to change internal variables
runtests.pl has lots of internal variables one might want to
change in certain situations, but adding a dedicated option
for every single one of them isn't practical.
Usage:
./runtests.pl -o TESTDIR=$privoxy_curl_test_dir -o HOSTIP=10.0.0.1 ...
-rwxr-xr-x | tests/runtests.pl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl index 70eb867cd..e836e9fa2 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -5429,6 +5429,15 @@ while(@ARGV) { # continue anyway, even if a test fail $anyway=1; } + elsif($ARGV[0] eq "-o") { + shift @ARGV; + if ($ARGV[0] =~ /^(\w+)=([\w.:\/\[\]-]+)$/) { + my ($variable, $value) = ($1, $2); + eval "\$$variable='$value'" or die "Failed to set \$$variable to $value: $@"; + } else { + die "Failed to parse '-o $ARGV[0]'. May contain unexpected characters.\n"; + } + } elsif($ARGV[0] eq "-p") { $postmortem=1; } @@ -5495,6 +5504,7 @@ Usage: runtests.pl [options] [test selection(s)] -L path require an additional perl library file to replace certain functions -l list all test case names/descriptions -n no valgrind + -o variable=value set internal variable to the specified value -P proxy use the specified proxy -p print log file contents when a test fails -R scrambled order (uses the random seed, see --seed) |