From db60a4c3b02ebdb2e0a666f164e2c46792c95716 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Fri, 9 Aug 2013 17:58:00 -0400 Subject: [PATCH] have the output parser generate a set of HTML files Signed-off-by: Jason Etheridge --- qa/test_output.css | 2 +- qa/test_output_filter.pl | 75 ------------------------------ qa/test_output_filter_html.pl | 1 - qa/test_output_webifier.pl | 106 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 107 insertions(+), 77 deletions(-) delete mode 100755 qa/test_output_filter.pl delete mode 120000 qa/test_output_filter_html.pl create mode 100755 qa/test_output_webifier.pl diff --git a/qa/test_output.css b/qa/test_output.css index c70a5bea8..60f92d997 100644 --- a/qa/test_output.css +++ b/qa/test_output.css @@ -1,4 +1,4 @@ -* { color: gray; } +.output { color: gray; } .comment { color: black; } .ok { color: green; font-weight: bold; } .error { color: red; font-weight: bold; } diff --git a/qa/test_output_filter.pl b/qa/test_output_filter.pl deleted file mode 100755 index 98f8e4b85..000000000 --- a/qa/test_output_filter.pl +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/perl - -my $state = 'skipping'; -my $error_count = 0; - -if ($0 =~ /html/) { - print "test output"; - print ""; - print "Jump to first error
\n";
-}
-
-while (my $line = <>) {
-    if ($line =~ /_\.-~=/) {
-        $state = 'outputting';
-    }
-    if ($state eq 'outputting') {
-        if ($0 =~ /html/) {
-            my $class = '';
-            if ($line =~ /^ok/
-                || $line =~ /\. ok/
-                || $line =~ /^PASS/
-                || $line =~ /\* OK/
-                || $line =~ /\* Jabber successfully connected/
-                || $line =~ /\* Database has the expected server encoding /
-            ) {
-                $class .= 'ok ';
-            }
-            $class .= 'error ' if ($line =~ /^err/i); 
-            if (($line =~ /^not ok/ && !($line =~ /TODO/))
-                || $line =~ /\. not ok/
-                || $line =~ /\* ERROR/
-                || $line =~ /\* WARNING/
-            ) {
-                $class .= 'notok ';
-                $error_count++;
-            }
-            if ($line =~ /^not ok/ && $line =~ /TODO/) {
-                $class .= 'todo ';
-            }
-            $class .= 'result ' if ($line =~ /^Result:/); 
-            $class .= 'pass ' if ($line =~ /^Result: PASS/); 
-            if ($line =~ /^Result: FAIL/) {
-                $class .= 'fail ';
-                $error_count++;
-            }
-            if ($line =~ /^#/
-                || $line =~ /Checks:/
-                || $line =~ /_\.-~=/
-                || $line =~ /=~-\._/
-                || $line =~ / tests /
-                || $line =~ /Failed /
-                || $line =~ /Passed /
-                || $line =~ /Files=/
-            ) {
-                $class .= 'comment ';
-            }
-            chomp $line;
-            my $html_line = "$line";
-            if ($error_count == 1) {
-                print "$html_line\n";
-            } else {
-                print "$html_line\n";
-            }
-        } else {
-            print $line;
-        }
-    }
-    if ($line =~ /=~-\._/) {
-        $state = 'skipping';
-    }
-}
-
-if ($0 =~ /html/) {
-    print "
\n"; -} diff --git a/qa/test_output_filter_html.pl b/qa/test_output_filter_html.pl deleted file mode 120000 index a7c1b3fb5..000000000 --- a/qa/test_output_filter_html.pl +++ /dev/null @@ -1 +0,0 @@ -test_output_filter.pl \ No newline at end of file diff --git a/qa/test_output_webifier.pl b/qa/test_output_webifier.pl new file mode 100755 index 000000000..c3e35fac9 --- /dev/null +++ b/qa/test_output_webifier.pl @@ -0,0 +1,106 @@ +#!/usr/bin/perl + +my $state = 'skipping'; +my $error_count = 0; +my $subpage_count = 0; + +open MAIN_PAGE, ">test.html"; +print MAIN_PAGE html_header('Test Output Summary'); +print MAIN_PAGE qq^Raw Output\n^; +print MAIN_PAGE "

Test Output Summary

\n"; +print MAIN_PAGE 'HTML generated on ' . `date` . "\n"; +print MAIN_PAGE "