print MAIN_PAGE 'HTML generated on ' . `date` . "\n";
print MAIN_PAGE "<ul>\n";
+open PASS_FAIL, ">pass_fail.txt";
+
while (my $line = <>) {
if ($line =~ /_\.-~= (.*)$/) {
$state = 'outputting';
print_pass_or_fail();
print MAIN_PAGE html_footer();
close MAIN_PAGE;
+close PASS_FAIL;
+update_rss();
sub html_header {
my $title = shift;
sub print_pass_or_fail {
if ($error_count) {
print MAIN_PAGE ' - <span class="fail">Failed</span>';
+ print PASS_FAIL "Failed\n";
} else {
if ($subpage_count) {
print MAIN_PAGE ' - <span class="pass">Passed</span>';
+ print PASS_FAIL "Passed\n";
}
}
}
+sub update_rss {
+ `touch pass_fail.txt.prev`;
+ if (`diff pass_fail.txt pass_fail.txt.prev`) {
+ $fail = `grep Failed pass_fail.txt`;
+ open RSS_FILE, ">test_rss.xml";
+ print RSS_FILE q^<?xml version="1.0"?>
+<rss version="2.0">
+ <channel>
+ <title>Test Output Summary</title>
+ <link>http://phasefx.evergreencatalog.com/~opensrf/test.html</link>
+ <description>Live Test Suite</description>
+ <item>^ . (
+ $fail
+ ? q^<title>Test Failure - http://tinyurl.com/kb9lrzu</title>
+ <link>http://phasefx.evergreencatalog.com/~opensrf/test.html</link>
+ <description>One or more tests failed</description>
+ ^
+ : q^<title>Test Success - http://tinyurl.com/kb9lrzu</title>
+ <link>http://phasefx.evergreencatalog.com/~opensrf/test.html</link>
+ <description>All tests passed</description>
+ ^
+ ) . q^</item>
+ </channel>
+</rss>
+^;
+ close RSS_FILE;
+ }
+ `mv pass_fail.txt pass_fail.txt.prev`;
+}