diff options
author | Niels Thykier <niels@thykier.net> | 2017-07-02 15:51:38 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2017-07-02 15:51:38 +0000 |
commit | 1e9c94352179e92a54b47a68ee67f6b3d74c4e62 (patch) | |
tree | 53e5c4956cac7b922ffdb84de2919fe955716767 /t/Test/DH.pm | |
parent | 823e57fc5dcd6e4cc78699e5837a836818632ff5 (diff) | |
download | debhelper-1e9c94352179e92a54b47a68ee67f6b3d74c4e62.tar.gz |
Test::DH: Support setting env in run_dh_tool
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 't/Test/DH.pm')
-rw-r--r-- | t/Test/DH.pm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/t/Test/DH.pm b/t/Test/DH.pm index 13d80b7c..34b3613f 100644 --- a/t/Test/DH.pm +++ b/t/Test/DH.pm @@ -60,6 +60,15 @@ sub run_dh_tool { if (not $pid) { $ENV{DH_COMPAT} = $compat; $ENV{DH_INTERNAL_TESTSUITE_SILENT_WARNINGS} = 1; + if (defined(my $env = $options->{env})) { + for my $k (sort(keys(%{$env}))) { + if (defined($env->{$k})) { + $ENV{$k} = $env->{$k}; + } else { + delete($ENV{$k}); + } + } + } if ($options->{quiet}) { open(STDOUT, '>', '/dev/null') or error("Reopen stdout: $!"); open(STDERR, '>', '/dev/null') or error("Reopen stderr: $!"); |