Skip to content

Commit f7ab5fa

Browse files
committed
Update test runner to handle Windows correctly
1 parent 4640ef6 commit f7ab5fa

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

run-tests

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,23 +101,29 @@ sub process($proc, $filename) {
101101
}
102102

103103
sub install() {
104-
my $zef := $*DISTRO.is-win ?? 'zef.bat' !! 'zef';
105-
my $proc := run $zef, "install", ".", "--verbose", "--/test", :out,:err,:merge;
104+
my $proc := run 'zef', "install", ".", "--verbose", "--/test", :out,:err,:merge;
106105
process($proc, "*installation*");
107106
}
108107

109108
sub test-dir($dir) {
110-
for $dir.IO.dir(:test(*.ends-with: '.t' | '.rakutest')).map(*.Str).sort {
111-
say "=== $_";
112-
my $proc := run "raku", "--ll-exception", "-I.", $_, :out,:err,:merge;
113-
process($proc, $_);
114-
$done++;
109+
my $io := $dir.IO;
110+
if $io.e && $io.d {
111+
for $io.dir(:test(*.ends-with: '.t' | '.rakutest')).map(*.Str).sort {
112+
say "=== $_";
113+
my $proc := run "raku", "--ll-exception", "-I.", $_, :out,:err,:merge;
114+
process($proc, $_);
115+
$done++;
116+
}
115117
}
116118
}
117119

118120
test-dir("t");
119-
test-dir($_) for dir("t", :test({ !.starts-with(".") && "t/$_".IO.d})).map(*.Str).sort;
120-
test-dir("xt") if $author && "xt".IO.e;
121+
if "t".IO.e {
122+
test-dir($_) for dir(
123+
"t", :test({ !.starts-with(".") && "t/$_".IO.d})
124+
).map(*.Str).sort;
125+
}
126+
test-dir("xt") if $author;
121127
if $install {
122128
install;
123129
++$done;

0 commit comments

Comments
 (0)