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/;
for my $test (1 .. $testcnt) {
my $start_time = time;
my $result;
+ unlink 'result';
try {
$generator->($test, $meta);
$result = $runner->($test, $meta);
};
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}
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