From: Marius Gavrilescu Date: Wed, 11 Mar 2015 21:33:46 +0000 (+0200) Subject: Include verifier stdout in non-Accepted results X-Git-Tag: 5999.000_005~23 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=ac964998cb64edc36511291d589942870a729a8d;p=gruntmaster-daemon.git Include verifier stdout in non-Accepted results --- diff --git a/lib/Gruntmaster/Daemon.pm b/lib/Gruntmaster/Daemon.pm index 9caa7dc..31e0398 100644 --- a/lib/Gruntmaster/Daemon.pm +++ b/lib/Gruntmaster/Daemon.pm @@ -9,6 +9,7 @@ our $VERSION = '5999.000_004'; use Gruntmaster::Daemon::Constants qw/ERR/; use Gruntmaster::Daemon::Format qw/prepare_files stopvms/; +use File::Slurp qw/read_file/; use File::Temp qw/tempdir/; use JSON qw/decode_json encode_json/; use Sys::Hostname qw/hostname/; @@ -63,6 +64,7 @@ sub process{ for my $test (1 .. $testcnt) { my $start_time = time; my $result; + unlink 'result'; try { $generator->($test, $meta); $result = $runner->($test, $meta); @@ -75,8 +77,10 @@ sub process{ }; if (ref $result) { - get_logger->trace("Test $test result is " . $result->[1]); - push @full_results, {id => $test, result => $result->[0], result_text => $result->[1], time => time - $start_time} + my $result_text = $result->[1]; + $result_text .= ': ' . read_file 'result' if -s 'result'; + get_logger->trace("Test $test result is " . $result_text); + push @full_results, {id => $test, result => $result->[0], result_text => $result_text, time => time - $start_time} } else { get_logger->trace("Test $test result is $result"); push @full_results, {id => $test, result => 0, result_text => $result, time => time - $start_time} diff --git a/t/problems/aminusb/tests/wa/meta.yml b/t/problems/aminusb/tests/wa/meta.yml index 145e8ec..c9d0830 100644 --- a/t/problems/aminusb/tests/wa/meta.yml +++ b/t/problems/aminusb/tests/wa/meta.yml @@ -6,19 +6,19 @@ expected_result_text: 0 points expected_results: - id: 1 result: 1 - result_text: Wrong answer + result_text: 'Wrong answer: Nu-i bine' - id: 2 result: 1 - result_text: Wrong answer + result_text: 'Wrong answer: Nu-i bine' - id: 3 result: 1 - result_text: Wrong answer + result_text: 'Wrong answer: Nu-i bine' - id: 4 result: 1 - result_text: Wrong answer + result_text: 'Wrong answer: Nu-i bine' - id: 5 result: 1 - result_text: Wrong answer + result_text: 'Wrong answer: Nu-i bine' files: prog: format: C diff --git a/t/problems/aminusb/ver.c b/t/problems/aminusb/ver.c index 3c0c239..30b851d 100644 --- a/t/problems/aminusb/ver.c +++ b/t/problems/aminusb/ver.c @@ -8,7 +8,8 @@ int main(void){ if(a-b == ret){ printf("20"); return 0; - } else + } else { + printf("Nu-i bine"); return 1; + } } -