mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-19 19:03:07 +02:00
Tests: Convert problems to python
This commit is contained in:
parent
2e3b8c8c2a
commit
ef477673d6
1 changed files with 29 additions and 30 deletions
|
@ -1,39 +1,38 @@
|
||||||
#!/usr/bin/env perl
|
#!/usr/bin/env python
|
||||||
|
|
||||||
use strict;
|
import re
|
||||||
use warnings;
|
from collections import defaultdict
|
||||||
|
|
||||||
if (open my $fh, '<', 'all.log')
|
errors = defaultdict(int)
|
||||||
{
|
skipped = defaultdict(int)
|
||||||
my $test_file;
|
expected = defaultdict(int)
|
||||||
my %errors;
|
|
||||||
my %skipped;
|
|
||||||
my %expected;
|
|
||||||
|
|
||||||
while (my $line = <$fh>)
|
file = re.compile("^# [/.]{2}(\S+\.t)$")
|
||||||
{
|
|
||||||
$test_file = $1 if $line =~ /^# (\S+\.t)$/;
|
|
||||||
$errors{$test_file}++ if $line =~ /^not /;
|
|
||||||
$skipped{$test_file}++ if $line =~ /^skip /;
|
|
||||||
$expected{$test_file}++ if $line =~ /^# EXPECTED_FAILURE: /;
|
|
||||||
}
|
|
||||||
|
|
||||||
close $fh;
|
with open("all.log") as fh:
|
||||||
|
for line in fh:
|
||||||
|
match = file.match(line)
|
||||||
|
if match:
|
||||||
|
filename = match.group(1)
|
||||||
|
|
||||||
print "Failed\n";
|
if line.startswith("not "):
|
||||||
printf "%-32s %4d\n", $_, $errors{$_}
|
errors[filename] += 1
|
||||||
for sort {$errors{$b} <=> $errors{$a}} keys %errors;
|
|
||||||
|
|
||||||
print "\n";
|
if line.startswith("skip "):
|
||||||
print "Skipped\n";
|
skipped[filename] += 1
|
||||||
printf "%-32s %4d\n", $_, $skipped{$_}
|
|
||||||
for sort {$skipped{$b} <=> $skipped{$a}} keys %skipped;
|
|
||||||
|
|
||||||
print "\n";
|
if line.startswith("# EXPECTED_FAILURE: "):
|
||||||
print "Expected failures (part of skipped)\n";
|
expected[filename] += 1
|
||||||
printf "%-32s %4d\n", $_, $expected{$_}
|
|
||||||
for sort {$expected{$b} <=> $expected{$a}} keys %expected;
|
|
||||||
}
|
|
||||||
|
|
||||||
exit 0;
|
|
||||||
|
|
||||||
|
print "Failed"
|
||||||
|
for key in sorted(errors):
|
||||||
|
print "%-32s %4d" % (key, errors[key])
|
||||||
|
|
||||||
|
print "\nSkipped"
|
||||||
|
for key in sorted(skipped):
|
||||||
|
print "%-32s %4d" % (key, skipped[key])
|
||||||
|
|
||||||
|
print "\nExpected failures (part of skipped)"
|
||||||
|
for key in sorted(expected):
|
||||||
|
print "%-32s %4d" % (key, expected[key])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue