1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
use strict;
use warnings;
my $rc = 0;
my @failed = ();
if (scalar(@ARGV) == 0) {
@ARGV = glob('test/test_*.sh');
}
for my $test (@ARGV) {
printf("%s\n", $test);
printf("%s\n", '-' x length($test));
printf("\n");
if (system('bash', $test) != 0) {
push @failed, $test;
}
}
if (scalar(@failed) > 0) {
$rc = 1;
print "\n";
print "FAILED TEST FILES:\n";
print "------------------\n";
for my $failed (@failed) {
print "$failed\n";
}
print "\n";
} else {
print "All tests passed!\n";
}
exit($rc);
|