From: Dave Rolsky Date: Thu, 17 Jun 2010 18:56:37 +0000 (-0500) Subject: Add script to test all exercises (useful when testing that exercises still work with... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1f9a53e7e1d5c425cd447ca21e042becba98b17a;p=gitmo%2Fmoose-presentations.git Add script to test all exercises (useful when testing that exercises still work with most recent Moose) --- diff --git a/moose-class/exercises/test-all-answers b/moose-class/exercises/test-all-answers new file mode 100755 index 0000000..0ea0b6f --- /dev/null +++ b/moose-class/exercises/test-all-answers @@ -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 ); +}