#!/usr/bin/perl
use strict;

$|=1;

my @tests=(<Tests/*.pl>);
my($longest) = sort { $b <=> $a } map { length($_) } (@tests);
my $failed=0;

foreach my $test (<Tests/*.pl>) {
	printf("Running %-*s... ", $longest, $test);
	my $r = system("$test > /dev/null 2>\&1");
	if($r) {
		print "Failed!\n";
		$failed++;
	} else {
		print "OK!\n";
	}
}

if($failed) {
	print "\nFailed $failed tests\n";
} else {
	print "\nAll tests passed!\n";
}
