aboutsummaryrefslogtreecommitdiff
path: root/tools/build/modules-test.pl
blob: 396f066827ea328912cbadf1b3f1b8324dc973f0 (plain)
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
#! perl

use Cwd;
use Getopt::Long;

GetOptions('verbose' => \my $verbose);

my $base = shift @ARGV;
my $perl6 = shift @ARGV;

while (<>) {
    next if /^\s*(#|$)/;
    my ($moduledir) = /(\S+)/;
    print "Testing modules/$moduledir with $perl6...\n";
    if (-d "$base/modules/$moduledir/t") {
        chdir("$base/modules/$moduledir");
        system('prove', $verbose ? '-v' : (), '-e', $perl6, '-r', 't');
    }
    else {
        print "...no t/ directory found.\n";
    }
    print "\n";
}

0;