diff options
author | Niels Thykier <niels@thykier.net> | 2017-07-02 11:38:50 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2017-07-02 11:38:50 +0000 |
commit | 376bedb5b198d37d4aad3240a5b6519c9bb2178f (patch) | |
tree | 5b90e2baf382e106daeff525b423b3ffa9c41150 /t | |
parent | de6ccbd49e06959a2861ce11230dad26ecc8934b (diff) |
Test::DH: Support extra per-test template files
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 't')
-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 8e710d25..82398f67 100644 --- a/t/Test/DH.pm +++ b/t/Test/DH.pm @@ -42,6 +42,7 @@ our @EXPORT = qw( our ($TEST_DH_COMPAT, $ROOT_OK, $ROOT_CMD); my $START_DIR = cwd(); +my $TEST_DIR; sub run_dh_tool { my (@cmd) = @_; @@ -104,6 +105,14 @@ sub _prepare_test_root { for my $file (@files) { install_file($file, "${dir}/${file}"); } + if (@::TEST_DH_EXTRA_TEMPLATE_FILES) { + my $test_dir = ($TEST_DIR //= dirname($0)); + for my $file (@::TEST_DH_EXTRA_TEMPLATE_FILES) { + my $install_dir = dirname($file); + install_dir($install_dir); + install_file("${test_dir}/${file}", "${dir}/${file}"); + } + } } return $dir; } |