File: problems

package info (click to toggle)
taskd 1.1.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 1,576 kB
  • ctags: 1,141
  • sloc: cpp: 13,971; python: 1,523; sh: 1,080; perl: 610; ansic: 48; makefile: 21
file content (32 lines) | stat: -rwxr-xr-x 598 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env perl

use strict;
use warnings;

if (open my $fh, '<', 'all.log')
{
  my $test_file;
  my %errors;
  my %skipped;

  while (my $line = <$fh>)
  {
    $test_file = $1        if $line =~ /^# (\S+\.t)$/;
    $errors{$test_file}++  if $line =~ /^not /;
    $skipped{$test_file}++ if $line =~ /^skip /;
  }

  close $fh;

  print "Failed\n";
  printf "%-32s %4d\n", $_, $errors{$_}
    for sort {$errors{$b} <=> $errors{$a}} keys %errors;

  print "\n";
  print "Skipped\n";
  printf "%-32s %4d\n", $_, $skipped{$_}
    for sort {$skipped{$b} <=> $skipped{$a}} keys %skipped;
}

exit 0;