Add script to test all exercises (useful when testing that exercises still work with...
Dave Rolsky [Thu, 17 Jun 2010 18:56:37 +0000 (13:56 -0500)]
moose-class/exercises/test-all-answers [new file with mode: 0755]

diff --git a/moose-class/exercises/test-all-answers b/moose-class/exercises/test-all-answers
new file mode 100755 (executable)
index 0000000..0ea0b6f
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use autodie qw( :all );
+
+use Path::Class qw( dir );
+
+system( qw( prove -v t/00-prereq.t ) );
+
+for my $t_file (
+    sort grep { !$_->is_dir() && $_->basename() =~ /^(?:0[1-9]|[1-9])/ }
+    dir('t')->children() ) {
+
+    ( my $t_less = $t_file->basename() ) =~ s/\.t$//;
+
+    my $lib = dir('answers')->subdir($t_less);
+
+    die "No lib dir for $t_file" unless -d $lib;
+
+    system( 'prove', '-I', $lib, '-v', $t_file );
+}