Skip to content

Commit

Permalink
Update test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jan 17, 2025
1 parent 1386aa5 commit 56df9ed
Showing 1 changed file with 66 additions and 1 deletion.
67 changes: 66 additions & 1 deletion run-tests
Original file line number Diff line number Diff line change
@@ -1,8 +1,66 @@
unit sub MAIN(:a($author), :i($install));
unit sub MAIN(
:a($author),
:i($install),
:$rmd,
:$disable-spesh,
:$disable-spesh-inline,
:$disable-JIT,
:$enable-spesh-nodelay,
:$enable-spesh-blocking,
:$enable-spesh-log,
);

say run(<raku --version>, :out).out.slurp.chomp;
say "Running on $*DISTRO.gist().\n";

if $rmd {
%*ENV<RAKUDO_MODULE_DEBUG> := 1;
say "RAKUDO_MODULE_DEBUG=1";
}

if $disable-spesh {
%*ENV<MVM_SPESH_DISABLE> := 1;
say "MVM_SPESH_DISABLE=1";
}

if $disable-spesh-inline {
%*ENV<MVM_SPESH_INLINE_DISABLE> := 1;
say "MVM_SPESH_INLINE_DISABLE=1";
}

if $disable-JIT {
%*ENV<MVM_JIT_DISABLE> := 1;
say "MVM_JIT_DISABLE=1";
}

if $enable-spesh-nodelay {
%*ENV<MVM_SPESH_NODELAY> := 1;
say "MVM_SPESH_NODELAY=1";
}

if $enable-spesh-blocking {
%*ENV<MVM_SPESH_BLOCKING> := 1;
say "MVM_SPESH_BLOCKING=1";
}

my $spesh-log;
if $enable-spesh-log {
$spesh-log = (
$enable-spesh-log ~~ Bool ?? "spesh-log" !! $enable-spesh-log
).IO;
%*ENV<MVM_SPESH_LOG> := $spesh-log.absolute;
say "MVM_SPESH_LOG=$spesh-log.relative()";
}

say ""
if $rmd
|| $disable-spesh
|| $disable-spesh-inline
|| $disable-JIT
|| $enable-spesh-nodelay
|| $enable-spesh-blocking
|| $enable-spesh-log;

say "Testing {
"dist.ini".IO.lines.head.substr(7)
}{
Expand All @@ -15,6 +73,7 @@ my $done = 0;
sub process($proc, $filename) {
if $proc {
$proc.out.slurp;
$spesh-log.unlink if $spesh-log;
}
else {
@failed.push($filename);
Expand All @@ -32,6 +91,12 @@ sub process($proc, $filename) {
else {
say "No output received, exit-code $proc.exitcode() ($proc.signal()):\n$proc.os-error()";
}

if $spesh-log {
say "\nSpesh log requested, showing last 20000 lines:";
say $spesh-log.lines(:!chomp).tail(20000).join;
$spesh-log.unlink;
}
}
}

Expand Down

0 comments on commit 56df9ed

Please sign in to comment.