From: Jason Etheridge Date: Thu, 8 Aug 2013 18:08:57 +0000 (-0400) Subject: within the HTML output, link to first error X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9d2e477a1763606f6e2d847f78efc463201fc907;p=working%2Frandom.git within the HTML output, link to first error Signed-off-by: Jason Etheridge --- diff --git a/qa/test_output_filter.pl b/qa/test_output_filter.pl index c747767ee..cbe479cb7 100755 --- a/qa/test_output_filter.pl +++ b/qa/test_output_filter.pl @@ -1,11 +1,12 @@ #!/usr/bin/perl my $state = 'skipping'; +my $error_count = 0; if ($0 =~ /html/) { print "test output"; print ""; - print "
\n";
+    print "Jump to first error
\n";
 }
 
 while (my $line = <>) {
@@ -26,10 +27,14 @@ while (my $line = <>) {
                 || $line =~ /\. not ok/
             ) {
                 $class .= 'notok ';
+                $error_count++;
             }
             $class .= 'result ' if ($line =~ /^Result:/); 
             $class .= 'pass ' if ($line =~ /^Result: PASS/); 
-            $class .= 'fail ' if ($line =~ /^Result: FAIL/); 
+            if ($line =~ /^Result: FAIL/) {
+                $class .= 'fail ';
+                $error_count++;
+            }
             if ($line =~ /^#/
                 || $line =~ /Checks:/
                 || $line =~ /_\.-~=/
@@ -42,7 +47,12 @@ while (my $line = <>) {
                 $class .= 'comment ';
             }
             chomp $line;
-            print "$line\n";
+            my $html_line = "$line";
+            if ($error_count == 1) {
+                print "$html_line\n";
+            } else {
+                print "$html_line\n";
+            }
         } else {
             print $line;
         }