This repository has been archived by the owner on Dec 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
/
update_msys2_report.pl
executable file
·90 lines (78 loc) · 2.56 KB
/
update_msys2_report.pl
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env perl
#
# Script to automatically generate regression_report-msys2.txt
# from regression_report-devel.txt and regress-msys2.list.
#use strict;
use lib './perl-lib';
use RegressionList;
my $version = $ARGV[0] || 'devel';
read_regression_list("regress-msys2.list", "any", 0, "");
my $input_name = 'regression_report-' . $version . '.txt';
open(my $input, '<', $input_name)
or die "ERROR - can't open '$input_name'";
my $output_name = 'regression_report-msys2-' . $version . '.txt';
open(my $output, '>', $output_name)
or die "ERROR - can't open '$output_name'";
# Copy header.
my $line_count = 0;
while (my $line = <$input>) {
print $output $line;
last if ++$line_count == 2;
}
# Output results for MSYS2 test exceptions.
my $passed = 0;
my $failed = 0;
my $not_impl = 0;
my $exp_fail = 0;
my %skip_test;
foreach my $name (@testlist) {
seek($input, 0, 0);
while (my $line = <$input>) {
my ($prefix, $result) = split(':', $line);
my $test_name = $prefix =~ s/^\s+//r; # strip leading spaces
next if $test_name ne $name;
if ($testtype{$test_name} eq "NI") {
print $output "$prefix: Not Implemented.\n";
$not_impl++;
} elsif ($testtype{$test_name} eq "EF") {
print $output "$prefix: Passed - expected fail.\n";
$exp_fail++;
} elsif ($testtype{$test_name} eq "CO") {
print $output "$prefix: Passed - CO.\n";
$passed++;
} elsif ($testtype{$test_name} eq "CE") {
print $output "$prefix: Passed - CE.\n";
$passed++;
} elsif ($testtype{$test_name} eq "RE") {
print $output "$prefix: Passed - RE.\n";
$passed++;
} else {
print $output "$prefix: Passed.\n";
$passed++;
}
}
$skip_test{$name} = 1;
}
# Output remaining results.
seek($input, 0, 0);
while (my $line = <$input>) {
my ($prefix, $result) = split(':', $line);
next if !$result;
my $test_name = $prefix =~ s/^\s+//r; # strip leading spaces
next if $skip_test{$test_name};
if ($line =~ /Not Implemented/) {
$not_impl++;
} elsif ($line =~ /expected fail/) {
$exp_fail++;
} elsif ($line =~ /Failed/) {
$failed++;
} elsif ($line =~ /Passed/) {
$passed++;
} else {
next;
}
print $output $line;
}
my $total = $passed + $failed + $not_impl + $exp_fail;
print $output "=" x 76 . "\n";
print $output "Test results:\n Total=$total, Passed=$passed, Failed=$failed, Not Implemented=$not_impl, Expected Fail=$exp_fail\n";