]>
Commit | Line | Data |
---|---|---|
5c5cd38a MG |
1 | package Gruntmaster::Daemon::Runner::Verifier; |
2 | ||
3 | use 5.014000; | |
4 | use strict; | |
5 | use warnings; | |
6 | ||
7 | use Gruntmaster::Daemon::Constants qw/WA/; | |
8 | use File::Slurp qw/slurp/; | |
9 | use Log::Log4perl qw/get_logger/; | |
10 | use Try::Tiny; | |
11 | ||
12 | ################################################## | |
13 | ||
14 | sub run{ | |
15 | my ($test, $meta) = @_; | |
16 | get_logger->trace("Running on test $test..."); | |
17 | $meta->{files}{prog}{run}->($meta->{files}{prog}{name}, fds => [qw/0 input 1 >output/], map {defined $meta->{$_} ? ($_ => $meta->{$_}) : () } qw/timeout olimit mlimit/); | |
18 | ||
19 | try { | |
20 | $meta->{files}{ver}{run}->($meta->{files}{ver}{name}, fds => [qw/0 input 3 output 1 >result/]); | |
21 | } catch { | |
22 | die [WA, "Wrong answer"] | |
23 | }; | |
24 | scalar slurp 'result'; | |
25 | } | |
26 | ||
27 | 1 |