diff options
author | Yves Orton <demerphq@gmail.com> | 2022-04-12 10:13:25 +0200 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2022-04-13 23:59:16 +0800 |
commit | aa2a6ac2998cc32b06ced91196387420610dac07 (patch) | |
tree | cdcfcfc46424f9d2298b248336d74a1745aca256 /t/harness | |
parent | ed024ff50121b42c6a5a36eaa9b89834255acb0f (diff) | |
download | perl-aa2a6ac2998cc32b06ced91196387420610dac07.tar.gz |
t/harness - use glob on arguments even on *nix
Historically in t/harness we used glob() on the arguments only on
Windows as its shell does not do wildcard expansion. However on *nix
build arguments passed into harness via the makefile are passed in via
the TEST_ARGS env var, where they are also NOT expanded by the shell.
The simple solution is to use glob on all arguments.
Historically we used the -re option, which does a similar task, for
`make test_reonly`, but this allows that target to be converted to use
the simpler and easier to understand globs. The -re and -nre arguments
are extracted from @ARGV prior to the glob() call so there is no
collision between the two. Frankly had we had this patch back in the day
I would have used globs when I created `make test_reonly` intead of
creating the -re option. But the -re option still has its uses so
this patch does not use it.
This means that it becomes trivial to create new specialized test make
targets and it makes it easier to do stuff like:
make test_harness TEST_ARGS="-v re/pat*.t"
for instance, without requiring the use of the -re option to specify
the list of files.
Diffstat (limited to 't/harness')
-rw-r--r-- | t/harness | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -92,12 +92,11 @@ if ($ENV{HARNESS_OPTIONS}) { if (@ARGV) { # If you want these run in speed order, just use prove - if ($^O eq 'MSWin32') { - @tests = map(glob($_),@ARGV); - } - else { - @tests = @ARGV; - } + + # Note: we use glob on even on *nix and not just on Windows + # because arguments might be passed in via the TEST_ARGS + # env var where they wont be expanded by the shell. + @tests = map(glob($_),@ARGV); # This is a hack to force config_heavy.pl to be loaded, before the # prep work for running a test changes directory. 1 if $Config{d_fork}; |