use Gruntmaster::Daemon;
-use Cwd qw/cwd/;
+use Cwd qw/getcwd/;
use File::Basename qw/fileparse/;
use File::Slurp qw/read_file/;
use File::Temp qw/tempdir/;
use List::Util qw/sum/;
use Log::Log4perl;
use Test::More;
-use YAML::Any qw/LoadFile/;
+use YAML::Tiny qw/LoadFile/;
##################################################
CONF
Log::Log4perl->init(\$log_conf);
-$ENV{PATH} = cwd . ':' . $ENV{PATH};
+$ENV{PATH} = getcwd . ':' . $ENV{PATH};
umask 0022;
sub check_job{
plan tests => 3 * sum map { my @temp = <$_/tests/*>; scalar @temp } @problems;
note "Problems to be tested: " . join ', ', @problems;
-my $tempdir = tempdir "gruntmaster-daemon-testingXXXX", TMPDIR => 1, CLEANUP => 1;
+my $tempdir = tempdir "gruntmasterd-testingXXXX", TMPDIR => 1, CLEANUP => 1;
chmod 0777, $tempdir;
my $job = 0;
for my $source (<$problem/tests/*>) {
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}";
+ if ($meta->{files}{prog}) {
+ 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;
+ my $savedcwd = getcwd;
chdir $tempdir;
Gruntmaster::Daemon::process $meta;
chdir $savedcwd;