3 my $state = 'skipping';
7 open MAIN_PAGE, ">test.html";
8 print MAIN_PAGE html_header('Test Output Summary');
9 print MAIN_PAGE qq^<a href="$ARGV[0]">Raw Output</a>\n^;
10 print MAIN_PAGE "<h1>Test Output Summary</h1>\n";
11 print MAIN_PAGE 'HTML generated on ' . `date` . "\n";
12 print MAIN_PAGE "<ul>\n";
14 open PASS_FAIL, ">pass_fail.txt";
16 while (my $line = <>) {
17 if ($line =~ /_\.-~= (.*)$/) {
18 $state = 'outputting';
22 print MAIN_PAGE qq^\n<li><a href="test.$subpage_count.html">$1</a>^;
23 open SUB_PAGE, ">test.$subpage_count.html";
24 print SUB_PAGE html_header($1);
25 print SUB_PAGE "<h1>$1</h1>\n<pre>";
27 if ($state eq 'outputting') {
28 my $class = 'output ';
33 || $line =~ /\* Jabber successfully connected/
34 || $line =~ /\* Database has the expected server encoding /
38 $class .= 'error ' if ($line =~ /^err/i);
39 if (($line =~ /^not ok/ && !($line =~ /TODO/))
40 || $line =~ /\. not ok/
41 || $line =~ /\* ERROR/
42 || $line =~ /\* WARNING/
47 if ($line =~ /^not ok/ && $line =~ /TODO/) {
50 $class .= 'result ' if ($line =~ /^Result:/);
51 $class .= 'pass ' if ($line =~ /^Result: PASS/);
52 if ($line =~ /^Result: FAIL/) {
68 my $html_line = "<span class='$class'>$line</span>";
69 print SUB_PAGE "$html_line\n";
71 if ($line =~ /=~-\._/) {
72 print SUB_PAGE "</pre>\n" . html_footer();
78 print MAIN_PAGE html_footer();
89 <link rel="stylesheet" type="text/css" href="test_output.css">
101 sub print_pass_or_fail {
103 print MAIN_PAGE ' - <span class="fail">Failed</span>';
104 print PASS_FAIL "Failed\n";
106 if ($subpage_count) {
107 print MAIN_PAGE ' - <span class="pass">Passed</span>';
108 print PASS_FAIL "Passed\n";
114 `touch pass_fail.txt.prev`;
115 if (`diff pass_fail.txt pass_fail.txt.prev`) {
116 $fail = `grep Failed pass_fail.txt`;
117 open RSS_FILE, ">test_rss.xml";
118 print RSS_FILE q^<?xml version="1.0"?>
121 <title>Test Output Summary</title>
122 <link>http://testing.evergreen-ils.org/~live/test.html</link>
123 <description>Live Test Suite</description>
126 ? q^<title>Test Failure - http://testing.evergreen-ils.org/~live/test.html</title>
127 <link>http://testing.evergreen-ils.org/~live/test.html</link>
128 <description>One or more tests failed</description>
130 : q^<title>Test Success - http://testing.evergreen-ils.org/~live/test.html</title>
131 <link>http://testing.evergreen-ils.org/~live/test.html</link>
132 <description>All tests passed</description>
140 `mv pass_fail.txt pass_fail.txt.prev`;