Help language development. Donate to The Perl Foundation

Prometheus::Client cpan:HANENKAMP last updated on 2021-03-04

run-tests
#!/usr/bin/env perl6
say run(<raku --version>, :out).out.slurp;

say "Testing raku-Prometheus-Client";

my @failed;
my $done   = 0;
for "t".IO.dir(:test(*.ends-with: '.t' | '.rakutest')).map(*.Str).sort {
    say "=== $_";
    my $proc = run $*EXECUTABLE.absolute(), "--ll-exception", "-Ilib", $_, :out, :merge;
    if $proc {
        $proc.out.slurp;
    }
    else {
        @failed.push($_);
        if $proc.out.slurp -> $output {
            my @lines = $output.lines;
            with @lines.first(*.starts-with(" from gen/moar/stage2"),:k) -> $index {
                say @lines[^$index].join("\n");
            }
            else {
                say $output;
            }
        }
        else {
            say "No output received, exit-code $proc.exitcode()";
        }
    }
    $done++;
}

if @failed {
    say "FAILED: {[email protected]} of $done:";
    say "  $_" for @failed;
    exit [email protected];
}

say "\nALL {"$done " if $done > 1}OK";

# vim: expandtab shiftwidth=4