#!/usr/bin/perl
use strict;

opendir(D, "Documents") or die($!);
open(O, ">run.html") or die($!);

my @files = grep(/^[^.].*\.html?$/, readdir(D));
print O "<html><body><table border=1 cellpadding=8>\n";
print O "<tr><td>file</td><td align=right>size</td><td>result</td></tr>\n";

for my $i (@files) {
	my $size = -s "Documents/$i";
	my $message = `CLASSPATH="Classes:/usr/share/kaffe/Klasses.jar" kaffe fit.FileRunner Documents/$i Results/$i 2>&1`;
	print O <<"";
		<tr>
			<td><a href=Documents/$i>$i</a></td>
			<td align=right>$size</td>
			<td><a href=Results/$i>$message</a></td>
		</tr>

	print "$i . . . $message";
}

print O "</table></body></html>\n";
