aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2020-01-28 15:40:22 +0100
committerPatrick Spek <p.spek@tyil.nl>2020-01-28 15:40:22 +0100
commitde44da9b28448e9159846a8e2d7d3f2d42bc373e (patch)
tree8e45f4e427c397c471cf14ea338a9472acd5a477
parenta5824552c7a850b25fcc6f4410df6873ad16450b (diff)
parent2df30e9b1c45d22371f9d7fd3e504e6cbffe5250 (diff)
Merge branch '2019.11-rc2'
-rw-r--r--tools/build/modules-test.pl49
1 files changed, 30 insertions, 19 deletions
diff --git a/tools/build/modules-test.pl b/tools/build/modules-test.pl
index 3d70fcf..c4b9d00 100644
--- a/tools/build/modules-test.pl
+++ b/tools/build/modules-test.pl
@@ -10,6 +10,7 @@ GetOptions('verbose' => \my $verbose);
my $base = shift @ARGV;
my $perl6 = shift @ARGV;
+my @failures;
while (<>) {
# Skip comments
@@ -18,33 +19,43 @@ while (<>) {
# Extract only the module name from the current line
my ($moduledir) = /(\S+)/;
+ if (! -d "$base/modules/$moduledir/t") {
+ print "[" . getcwd . "] ...no t/ directory found.\n";
+ next;
+ }
+
# Run the tests through prove
- if (-d "$base/modules/$moduledir/t") {
- chdir("$base/modules/$moduledir");
+ chdir("$base/modules/$moduledir");
- my @cmd = (
- 'prove',
- $verbose ? '-v' : (),
- '-e', $perl6,
- '-r',
- 't',
- );
+ my @cmd = (
+ 'prove',
+ $verbose ? '-v' : (),
+ '-e', $perl6,
+ '-r',
+ 't',
+ );
- # Show the command that's going to be ran, for debugging purposes
- print "[" . getcwd . "] @cmd\n";
+ # Show the command that's going to be ran, for debugging purposes
+ print "[" . getcwd . "] @cmd\n";
- # Actually run the command
- my $exit = system "@cmd";
+ # Actually run the command
+ my $exit = system "@cmd";
- # Exit early if any errors occurred
- exit 1 if $exit;
- }
- else {
- print "...no t/ directory found.\n";
+ # Exit early if any errors occurred
+ if ($exit) {
+ push @failures, $_;
}
print "\n";
}
# If we reach this, no errors have been found
-exit 0;
+if (@failures) {
+ print "The following modules failed their tests:\n";
+
+ foreach (@failures) {
+ print "- $_\n";
+ }
+
+ exit 1;
+}