This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/TEST -deparse: list unexpectedly passing scripts
authorDavid Mitchell <davem@iabyn.com>
Thu, 23 Feb 2017 12:52:09 +0000 (12:52 +0000)
committerDavid Mitchell <davem@iabyn.com>
Mon, 5 Jun 2017 11:52:17 +0000 (12:52 +0100)
Currently Porting/deparse-skips.txt maintains a list of test scripts
that are expected fail when run after deparsing. If a script unexpectedly
passes, its listed as a failure in the summary at the end of the run.

Make the summary include a list of unexpected passes too to make it
easier to distinguish from failures.

t/TEST

diff --git a/t/TEST b/t/TEST
index 6dc9587..0c16dd2 100755 (executable)
--- a/t/TEST
+++ b/t/TEST
@@ -23,6 +23,8 @@ my $deparse_failures;
 # And skip even running these
 my $deparse_skips;
 
+my $deparse_skip_file = '../Porting/deparse-skips.txt';
+
 # directories with special sets of test switches
 my %dir_to_switch =
     (base => '',
@@ -562,6 +564,7 @@ EOT
     my $tested_files  = 0;
     my $totmax = 0;
     my %failed_tests;
+    my @unexpected_pass; # files where deparse-skips.txt says fail but passed
     my $toolnm;                # valgrind, cachegrind, perf
 
     while (my $test = shift @tests) {
@@ -715,6 +718,7 @@ EOT
            if (!$failure) {
                # Wait, it didn't fail? Great news! Tell someone!
                $failure = "FAILED--all tests passed but test should have failed";
+               push @unexpected_pass, $test;
            } else {
                # Bah, still failing. Mask it.
                print "${te}skipped\n";
@@ -774,6 +778,17 @@ EOT
        for my $test ( sort keys %failed_tests ) {
            print "\t$test\n";
        }
+
+       if (@unexpected_pass) {
+           print <<EOF;
+
+The following scripts were expected to fail under -deparse (at least
+according to $deparse_skip_file), but unexpectedly succeeded:
+EOF
+           print "\t$_\n" for sort @unexpected_pass;
+           print "\n";
+       }
+
        warn <<'SHRDLU_1';
 ### Since not all tests were successful, you may want to run some of
 ### them individually and examine any diagnostic messages they produce.
@@ -953,7 +968,7 @@ sub _process_deparse_config {
     my @deparse_failures;
     my @deparse_skips;
 
-    my $f = '../Porting/deparse-skips.txt';
+    my $f = $deparse_skip_file;
 
     my $skips;
     if (!open($skips, '<', $f)) {