-#!/usr/bin/perl -w
use v5.14;
use strict;
use warnings;
use File::Slurp qw/read_file/;
use File::Temp qw/tempdir/;
use File::Which qw/which/;
+use FindBin;
use Hash::Merge qw/merge/;
use List::Util qw/sum/;
use Log::Log4perl;
##################################################
use constant COMPILER => {
- qw/C gcc
+ qw/BRAINFUCK bfc
+ C gcc
CPP g++
+ D dmd
+ GOLFSCRIPT golfscript
MONO gmcs
JAVA javac
+ JAVASCRIPT node
+ JULIA julia
PASCAL fpc
GOLANG go
GCCGO gccgo
HASKELL ghc
PERL perl
- PYTHON python
+ PHP php
+ PYTHON python2.7
RUBY ruby
+ RUST rustc
+ OBERON obc
+ OCAML ocaml
SBCL sbcl/};
+my %needs_fork = map { $_ => 1 } qw/GOLANG GOLFSCRIPT GCCGO JAVA JAVASCRIPT JULIA RUBY SBCL/;
+
my $loglevel = $ENV{TEST_LOG_LEVEL} // ($ENV{TEST_VERBOSE} ? 'TRACE' : 'OFF');
my $log_conf = <<CONF;
log4perl.category.Gruntmaster.Daemon = $loglevel, stderr
Log::Log4perl->init(\$log_conf);
$ENV{PATH} = getcwd . ':' . $ENV{PATH};
+$ENV{PATH} = "$FindBin::Bin/../blib/script:" . $ENV{PATH};
umask 0022;
sub check_job{
if ($meta->{files}{prog}) {
my $format = $meta->{files}{prog}{format};
my $compiler = COMPILER->{$format};
- skip "$compiler not found in path", 3 unless $ENV{GRUNTMASTER_VM} || which $compiler;
- skip "$format requires multiple processes. Set GRUNTMASTER_KILL_USER and GRUNTMASTER_SUDO to allow multiple processes.", 3 if !$ENV{GRUNTMASTER_KILL_USER} && ($format eq 'JAVA' || $format eq 'GOLANG' || $format eq 'GCCGO' || $format eq 'RUBY');
+# skip "$compiler not found in path", 3 unless $ENV{GRUNTMASTER_VM} || which $compiler;
+# skip "$format requires multiple processes. Set GRUNTMASTER_KILL_USER and GRUNTMASTER_SUDO to allow multiple processes.", 3 if !$ENV{GRUNTMASTER_KILL_USER} && $needs_fork{$format};
$meta->{files}{prog}{content} = read_file "$source/$meta->{files}{prog}{name}";
}
$meta = merge $meta, $pbmeta;