Include verifier stdout in non-Accepted results
authorMarius Gavrilescu <marius@ieval.ro>
Wed, 11 Mar 2015 21:33:46 +0000 (23:33 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Wed, 11 Mar 2015 21:33:46 +0000 (23:33 +0200)
lib/Gruntmaster/Daemon.pm
t/problems/aminusb/tests/wa/meta.yml
t/problems/aminusb/ver.c

index 9caa7dc..31e0398 100644 (file)
@@ -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}
index 145e8ec..c9d0830 100644 (file)
@@ -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
index 3c0c239..30b851d 100644 (file)
@@ -8,7 +8,8 @@ int main(void){
        if(a-b == ret){
                printf("20");
                return 0;
-       } else
+       } else {
+               printf("Nu-i bine");
                return 1;
+       }
 }
-
This page took 0.034115 seconds and 4 git commands to generate.