Skip to content

Instantly share code, notes, and snippets.

@colomon
Created December 14, 2011 19:13
Show Gist options
  • Save colomon/1478008 to your computer and use it in GitHub Desktop.
Save colomon/1478008 to your computer and use it in GitHub Desktop.
my %tests;
for @*ARGS -> $file {
say "Scanning $file";
my $fh = open $file or die "Unable to open $file";
for $fh.lines {
when /plan \s+ (\d+)/ { %tests{$file} = +$0; last; }
}
}
my %tests-run;
my $fh = open "t/spectest.data" or die "Unable to open t/spectest.data";
for $fh.lines {
when /^'#'/ { }
%tests-run{"t/spec/$_"} = 1;
}
$fh.close;
say %tests.pairs.perl;
say "Results: ";
for %tests.pairs.sort({ $^a.value <=> $^b.value }) -> $kv {
my $file = $kv.key;
my $test-count = $kv.value;
if %tests-run{$file} {
# say "$file has $test-count tests";
} else {
say "$file has $test-count tests";
# say "$file has $test-count tests and is NOT BEING RUN";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment