X-Git-Url: http://git.ieval.ro/?p=gruntmaster-daemon.git;a=blobdiff_plain;f=t%2F01-jobs.t;h=4b763104d1dce74d4f0de8b0883db157b458e53f;hp=a4e0c027ad25ca6b59314a3a1c166d2f1aefd62a;hb=b8f7001a80665c35f33aed657ead2a426d4efac8;hpb=d9c408103c63368802d73c9147a273074e520e65;ds=sidebyside diff --git a/t/01-jobs.t b/t/01-jobs.t index a4e0c02..4b76310 100644 --- a/t/01-jobs.t +++ b/t/01-jobs.t @@ -9,6 +9,7 @@ use Cwd qw/cwd/; use File::Basename qw/fileparse/; use File::Slurp qw/read_file/; use File::Temp qw/tempdir/; +use File::Which qw/which/; use Hash::Merge qw/merge/; use List::Util qw/sum/; use Log::Log4perl; @@ -17,6 +18,18 @@ use YAML::Any qw/LoadFile/; ################################################## +use constant COMPILER => { + qw/C gcc + CPP g++ + MONO gmcs + JAVA javac + PASCAL fpc + GOLANG go + GCCGO gccgo + HASKELL ghc + PERL perl + PYTHON python/}; + my $loglevel = $ENV{TEST_LOG_LEVEL} // ($ENV{TEST_VERBOSE} ? 'TRACE' : 'OFF'); my $log_conf = <; +@problems = grep { $_ !~ /hello/ } @problems unless $ENV{RELEASE_TESTING} || $ENV{TEST_PROBLEMS}; + plan tests => 3 * sum map { my @temp = <$_/tests/*>; scalar @temp } @problems; note "Problems to be tested: " . join ', ', @problems; @@ -64,15 +79,20 @@ for my $problem (@problems) { note "Now testing problem $pbmeta->{name} ($pbmeta->{description})"; for my $source (<$problem/tests/*>) { - my $meta = LoadFile "$source/meta.yml"; - $meta->{files}{prog}{content} = read_file "$source/$meta->{files}{prog}{name}"; - $meta = merge $meta, $pbmeta; - note "Running $meta->{test_name} ($meta->{test_description})..."; - my $savedcwd = cwd; - chdir $tempdir; - Gruntmaster::Daemon::process $meta; - chdir $savedcwd; - check_job $meta; + SKIP: { + my $meta = LoadFile "$source/meta.yml"; + my $compiler = COMPILER->{$meta->{files}{prog}{format}}; + skip "$compiler not found in path", 3 unless $ENV{GRUNTMASTER_VM} || which $compiler; + local $TODO = $meta->{todo} if exists $meta->{todo}; + $meta->{files}{prog}{content} = read_file "$source/$meta->{files}{prog}{name}"; + $meta = merge $meta, $pbmeta; + note "Running $meta->{test_name} ($meta->{test_description})..."; + my $savedcwd = cwd; + chdir $tempdir; + Gruntmaster::Daemon::process $meta; + chdir $savedcwd; + check_job $meta; + } } } }