Bump version and update Changes
[gruntmaster-daemon.git] / lib / Gruntmaster / Daemon / Runner / File.pm
index bfa9a05aee774bdc798f71d1664499fa284c67fd..6d7b8f81fa8195d8c98469468373df6ee079f50d 100644 (file)
@@ -8,7 +8,7 @@ use Gruntmaster::Daemon::Constants qw/WA/;
 use File::Slurp qw/slurp/;
 use Log::Log4perl qw/get_logger/;
 
-our $VERSION = "5999.000_002";
+our $VERSION = "5999.000_003";
 
 ##################################################
 
@@ -21,14 +21,13 @@ sub run{
        if (exists $meta->{okfile}) {
                $ok = $meta->{okfile}[$test - 1]
        } else {
-               my $ct = defined $Gruntmaster::Data::contest ? "ct/$Gruntmaster::Data::contest" : '';
-               $ok = slurp "/var/lib/gruntmasterd/$ct/pb/$meta->{problem}/$test.ok"
+               $ok = slurp "/var/lib/gruntmasterd/pb/$meta->{problem}/$test.ok"
        }
 
        $out =~ s/^\s+//;
        $ok  =~ s/^\s+//;
-       $out =~ s/\s+/ /;
-       $ok  =~ s/\s+/ /;
+       $out =~ s/\s+/ /g;
+       $ok  =~ s/\s+/ /g;
        $out =~ s/\s+$//;
        $ok  =~ s/\s+$//;
 
@@ -48,11 +47,16 @@ Gruntmaster::Daemon::Runner::File - Compare output with static text files
 =head1 SYNOPSIS
 
   use Gruntmaster::Daemon::Runner::File;
-  Gruntmaster::Daemon::Runner::File->run(5, $meta);
+  Gruntmaster::Daemon::Runner::File::run(5, $meta);
 
 =head1 DESCRIPTION
 
-Gruntmaster::Daemon::Runner::File is a runner which compares the program output for test C<$test> with C<< $meta->{tests}[$test - 1] >>. Before comparing, leading and trailing whitespace is removed, and sequences of whitespace are converted to a single space.
+Gruntmaster::Daemon::Runner::File is a runner which compares the program output for test C<$test> with a static output. Before comparing, leading and trailing whitespace is removed, and sequences of whitespace are converted to a single space.
+
+If C<< $meta->{okfile} >> exists, the output is compared to C<< $meta->{okfile}[$test - 1] >>.
+Otherwise, the output is compared to F<< /var/lib/gruntmasterd/pb/$meta->{problem}/$test.ok >>.
+
+If the two strings match, the verdict is C<< $meta->{tests}[$test - 1] >>. Otherwise, the verdict is C<[WA, "Wrong answer"]>.
 
 =head1 AUTHOR
 
This page took 0.009858 seconds and 4 git commands to generate.