Author: earle Date: 2008-01-30 14:00:29 +0000 (Wed, 30 Jan 2008) New Revision: 1147
Added: status/parse.pl status/templates/ status/templates/tests.tt Modified: status/runbuild.pl Log: First stab at test output parsing.
Added: status/parse.pl =================================================================== --- status/parse.pl (rev 0) +++ status/parse.pl 2008-01-30 14:00:29 UTC (rev 1147) @@ -0,0 +1,38 @@ +#!/usr/bin/perl + +use warnings; +use strict; + +use Data::Dumper; +use Template; + +my $file = $ARGV[0]; + +die 'No input file specified' unless $file; +die "That file doesn't exist" unless -e $file; +die "That isn't a plain file" unless -f _; +die "That file isn't readable" unless -r _; + +open (my $RESULTS, '<', $file) or die "Can't open $file: $!"; +my @lines = <$RESULTS>; +close $RESULTS; + +my (%tests, $current_test); + +foreach (@lines) { + chomp; + + if (m{^t/(.*?).}) { + $current_test = $1; + } elsif (/^ok$/) { + $tests{$current_test} = 100; + } elsif (/Failed .*? tests, (.*?)% okay/) { + $tests{$current_test} = $1; + } +} + +my $tt = Template->new({ + INCLUDE_PATH => 'templates', +}); + +$tt->process('tests.tt', { 'tests' => %tests }) or die $tt->error; \ No newline at end of file
Modified: status/runbuild.pl =================================================================== --- status/runbuild.pl 2008-01-29 18:36:29 UTC (rev 1146) +++ status/runbuild.pl 2008-01-30 14:00:29 UTC (rev 1147) @@ -28,4 +28,7 @@ install_path=script=$config{'script'} \ install_path=arch=$config{'arch'} \ install_path=libdoc=$config{'libdoc'} \ - install_path=bindoc=$config{'bindoc'}"); \ No newline at end of file + install_path=bindoc=$config{'bindoc'}"); + +system("perl Build"); +system("perl Build test verbose=1 2>&1 > output.txt"); \ No newline at end of file
Added: status/templates/tests.tt =================================================================== --- status/templates/tests.tt (rev 0) +++ status/templates/tests.tt 2008-01-30 14:00:29 UTC (rev 1147) @@ -0,0 +1,16 @@ +<html> +<head> + <title>Test Results</title> +</head> +<body> +<h1>Test Results</h1> +<table> +[% FOREACH test IN tests.keys.sort %] + <tr> + <td>[% test %]</td> + <td>[% tests.$test %]%</td> + </tr> +[% END %] +</table> +</body> +</html> \ No newline at end of file