From 9d2e477a1763606f6e2d847f78efc463201fc907 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Thu, 8 Aug 2013 14:08:57 -0400 Subject: [PATCH] within the HTML output, link to first error Signed-off-by: Jason Etheridge --- qa/test_output_filter.pl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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;
         }
-- 
2.11.0