]> iEval git - gruntmaster-daemon.git/commitdiff
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 9caa7dc9252123539425b93fbdf2a590040d39e6..31e03984c4f370ab1f951508a89bcee2f963e4b6 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 145e8ece239ad9576113536ce3581f76d9f39532..c9d0830dc3291a97eab5e470b97a13f185173389 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 3c0c239f1a2814b352c29b4bf969f6382eb26ae8..30b851db5d36e2c8aa680264079bfa5eef91f4cc 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.034931 seconds and 4 git commands to generate.