From: Marius Gavrilescu Date: Wed, 10 Feb 2016 22:41:30 +0000 (+0000) Subject: Support input for interactive problem verifiers X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=b59254d76ff369f1ce942b8e8baab746772f65f4;p=gruntmaster-daemon.git Support input for interactive problem verifiers --- diff --git a/lib/Gruntmaster/Daemon/Generator/Undef.pm b/lib/Gruntmaster/Daemon/Generator/Undef.pm index 17d1622..15f3bab 100644 --- a/lib/Gruntmaster/Daemon/Generator/Undef.pm +++ b/lib/Gruntmaster/Daemon/Generator/Undef.pm @@ -5,13 +5,15 @@ use strict; use warnings; use Log::Log4perl qw/get_logger/; +use File::Slurp qw/write_file/; our $VERSION = '5999.000_005'; ################################################## sub generate{ - get_logger->trace("Pretending to generate test $_[0]..."); + get_logger->trace("Generating empty test $_[0]..."); + write_file 'input', ''; } 1; diff --git a/lib/Gruntmaster/Daemon/Runner/Interactive.pm b/lib/Gruntmaster/Daemon/Runner/Interactive.pm index d16e08e..3595e4a 100644 --- a/lib/Gruntmaster/Daemon/Runner/Interactive.pm +++ b/lib/Gruntmaster/Daemon/Runner/Interactive.pm @@ -27,7 +27,7 @@ sub run{ my $fail; @fds = $ENV{GRUNTMASTER_VM} ? qw,1 >/dev/ttyS1 0 /dev/ttyS1, : qw/1 >fifo1 0 fifo2/; try { - $meta->{files}{ver}{run}->($meta->{files}{ver}{name}, fds => [@fds, qw,4 >result,], args => [$test], map { $_ => $meta->{$_} } qw/timeout mlimit/); + $meta->{files}{ver}{run}->($meta->{files}{ver}{name}, fds => [@fds, qw,3 input 4 >result,], args => [$test], map { $_ => $meta->{$_} } qw/timeout mlimit/); } catch { $fail = [WA, 'Wrong Answer']; };