Update documentation
authorMarius Gavrilescu <marius@ieval.ro>
Wed, 23 Apr 2014 07:50:25 +0000 (10:50 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Wed, 23 Apr 2014 07:50:25 +0000 (10:50 +0300)
gruntmaster-compile
lib/Gruntmaster/Daemon/Generator.pod [new file with mode: 0644]
lib/Gruntmaster/Daemon/Generator/File.pm
lib/Gruntmaster/Daemon/Generator/Run.pm
lib/Gruntmaster/Daemon/Judge.pod [new file with mode: 0644]
lib/Gruntmaster/Daemon/Judge/Absolute.pm
lib/Gruntmaster/Daemon/Judge/Points.pm
lib/Gruntmaster/Daemon/Runner.pod [new file with mode: 0644]
lib/Gruntmaster/Daemon/Runner/File.pm
lib/Gruntmaster/Daemon/Runner/Interactive.pm
lib/Gruntmaster/Daemon/Runner/Verifier.pm

index aebbffc1f4376ecebf074537a068d01b0057f4cf..4e600966c5799cb83b11c1ace435d4c3f5067bb9 100755 (executable)
@@ -64,7 +64,7 @@ Compile commands for each format:
 
 =item PASCAL
 
-  fpc -dONLINE_JUDGE -O2 -n $input
+  fpc -dONLINE_JUDGE -O2 $input
 
 =item PERL
 
diff --git a/lib/Gruntmaster/Daemon/Generator.pod b/lib/Gruntmaster/Daemon/Generator.pod
new file mode 100644 (file)
index 0000000..bec7bc8
--- /dev/null
@@ -0,0 +1,42 @@
+=encoding utf-8
+
+=head1 NAME
+
+Gruntmaster::Daemon::Generator - Modules for generating input files
+
+=head1 SYNOPSIS
+
+  use Gruntmaster::Daemon::Generator::Foo;
+  Gruntmaster::Daemon::Generator::Foo::generate(5, $meta);
+
+=head1 DESCRIPTION
+
+A generator is a module that creates input data. Each generator has a subroutine, B<generate>(I<$test>, I<$meta>), which generates the input data for the given test.
+
+There are three generators in this distribution:
+
+=over
+
+=item L<Gruntmaster::Daemon::Generator::File> - Generate tests from files
+
+=item L<Gruntmaster::Daemon::Generator::Run> - Generate tests from program output
+
+=item L<Gruntmaster::Daemon::Generator::Undef> - Pretend to generate tests
+
+=back
+
+=head1 AUTHOR
+
+Marius Gavrilescu E<lt>marius@ieval.roE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2014 by Marius Gavrilescu
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+
+=cut
index 877eb4325b128b4b65ab13b176f149d003d5f0a1..847e91590a52dd5a962ed679f97a0de187f494b6 100644 (file)
@@ -34,11 +34,13 @@ Gruntmaster::Daemon::Generator::File - Generate tests from files
 =head1 SYNOPSIS
 
   use Gruntmaster::Daemon::Generator::File;
-  Gruntmaster::Daemon::Generator::File->generate(5, $meta);
+  Gruntmaster::Daemon::Generator::File::generate(5, $meta);
 
 =head1 DESCRIPTION
 
-Gruntmaster::Daemon::Generator::File is a static test generator. Test C<$i> is C<< $meta->{infile}[$i - 1] >>.
+Gruntmaster::Daemon::Generator::File is a static test generator.
+If C<< $meta->{infile} >> exists, the input for test C<$i> is C<< $meta->{infile}[$i - 1] >>.
+Otherwise, the input for test C<$i> is F<< /var/lib/gruntmasterd/pb/$meta->{problem}/$test.in >>.
 
 =head1 AUTHOR
 
index d971e43f2fa420c24454059670ff8c4746bcfe7a..195f336ba0722b93c7d647ba66112fde01880543 100644 (file)
@@ -33,7 +33,7 @@ Gruntmaster::Daemon::Generator::Run - Generate tests from program output
 
 =head1 DESCRIPTION
 
-Gruntmaster::Daemon::Generator::Run is a dynamic test generator. Test C<$i> is the output of running C<< $meta->{files}{gen} >> with argument C<$i>.
+Gruntmaster::Daemon::Generator::Run is a dynamic test generator. The input for test C<$i> is the output of running C<< $meta->{files}{gen} >> with argument C<$i>.
 
 =head1 AUTHOR
 
diff --git a/lib/Gruntmaster/Daemon/Judge.pod b/lib/Gruntmaster/Daemon/Judge.pod
new file mode 100644 (file)
index 0000000..e1f29c5
--- /dev/null
@@ -0,0 +1,40 @@
+=encoding utf-8
+
+=head1 NAME
+
+Gruntmaster::Daemon::Judge - Modules for judging jobs
+
+=head1 SYNOPSIS
+
+  use Gruntmaster::Daemon::Runner::Foo;
+  my $verdict = Gruntmaster::Daemon::Runner::Foo::judge(@results);
+
+=head1 DESCRIPTION
+
+A judge is a module that takes a list of verdicts and returns a single, combined verdict.
+
+There are two judges in this distribution:
+
+=over
+
+=item L<Gruntmaster::Daemon::Judge::Absolute> - All-or-nothing ACM-style judge
+
+=item L<Gruntmaster::Daemon::Judge::Points> - 0 to 100 points IOI-style judge
+
+=back
+
+=head1 AUTHOR
+
+Marius Gavrilescu E<lt>marius@ieval.roE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2014 by Marius Gavrilescu
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+
+=cut
index e0b04e58dc7cf4c2a7d8b9cc42ce1dbe6316afdc..d7e2ec001f5de1e66889aa2eac894ae3160ed236 100644 (file)
@@ -27,7 +27,7 @@ Gruntmaster::Daemon::Judge::Absolute - All-or-nothing ACM-style judge
 =head1 SYNOPSIS
 
   use Gruntmaster::Daemon::Judge::Absolute;
-  Gruntmaster::Daemon::Judge::Absolute->judge($result1, $result2, $result3, ...);
+  Gruntmaster::Daemon::Judge::Absolute::judge($result1, $result2, $result3, ...);
 
 =head1 DESCRIPTION
 
index b153948cbe2aff5e0cbc6507b2a1c7028a426178..230e56d3dd514fa6db82ff7070afcd3caecd8071 100644 (file)
@@ -31,7 +31,7 @@ Gruntmaster::Daemon::Judge::Points - 0 to 100 points IOI-style judge
 =head1 SYNOPSIS
 
   use Gruntmaster::Daemon::Judge::Points;
-  Gruntmaster::Daemon::Judge::Points->judge($result1, $result2, $result3, ...);
+  Gruntmaster::Daemon::Judge::Points::judge($result1, $result2, $result3, ...);
 
 =head1 DESCRIPTION
 
diff --git a/lib/Gruntmaster/Daemon/Runner.pod b/lib/Gruntmaster/Daemon/Runner.pod
new file mode 100644 (file)
index 0000000..44db619
--- /dev/null
@@ -0,0 +1,44 @@
+=encoding utf-8
+
+=head1 NAME
+
+Gruntmaster::Daemon::Runner - Modules for running tests
+
+=head1 SYNOPSIS
+
+  use Gruntmaster::Daemon::Runner::Foo;
+  Gruntmaster::Daemon::Runner::Foo::run(5, $meta);
+
+=head1 DESCRIPTION
+
+A runner is a module that runs a program on some input data, returning a verdict. Each runner has a subroutine, B<run>(I<$test>, I<$meta>), which runs the program on the given test and returns a verdict.
+
+If the test is successful, the verdict is a string, usually a message (such as C<"Ok">) or a number of points (such as C<"10">). Otherwise, the verdict is an array reference with two elements: an error code (see L<Gruntmaster::Daemon::Constants> for a list) and an error message.
+
+There are three runners in this distribution:
+
+=over
+
+=item L<Gruntmaster::Daemon::Runner::File> - Compare output with static text files
+
+=item L<Gruntmaster::Daemon::Runner::Verifier> - Check the program output with a verifier
+
+=item L<Gruntmaster::Daemon::Runner::Interactive> - Make an interactive verifier talk to the program
+
+=back
+
+=head1 AUTHOR
+
+Marius Gavrilescu E<lt>marius@ieval.roE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2014 by Marius Gavrilescu
+
+This library is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+
+=cut
index 9193861378142c22b2e809ed22e2054b87db344f..55afd70e1560e860d3d8f0a479c882de790e2a24 100644 (file)
@@ -21,8 +21,7 @@ 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+//;
@@ -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
 
index 5a986754c8b6451471c91d0957f4bb1a6a787114..affac1817f2d07d4ab6d121d272ab2124377f854 100644 (file)
@@ -58,13 +58,13 @@ Gruntmaster::Daemon::Runner::Interactive - Make an interactive verifier talk to
 =head1 SYNOPSIS
 
   use Gruntmaster::Daemon::Runner::Interactive;
-  Gruntmaster::Daemon::Runner::Interactive->run(5, $meta);
+  Gruntmaster::Daemon::Runner::Interactive::run(5, $meta);
 
 =head1 DESCRIPTION
 
 B<WARNING: This runner is experimental!>
 
-Gruntmaster::Daemon::Runner::Interactive is a runner which runs the program and an interactive verifier in parallel, connecting each program's STDIN to the other's STDOUT. The verifier, C<< $meta->{files}{int} >>, should return nonzero if the program gives an incorrect answer, and print the test score to fd 4 then return 0 if the answer is correct.
+Gruntmaster::Daemon::Runner::Interactive is a runner which runs the program and an interactive verifier in parallel, connecting each program's STDIN to the other's STDOUT. The verifier, C<< $meta->{files}{ver} >>, should return nonzero if the program gives an incorrect answer, or print the test score to fd 4 then return 0 if the answer is correct.
 
 =head1 AUTHOR
 
index 10f0287dba8e246fac67a02ece91f3efb8993398..f9ee43b19c476b4dcb79e5167849b7ec61483d04 100644 (file)
@@ -38,7 +38,7 @@ Gruntmaster::Daemon::Runner::Verifier - Check the program output with a verifier
 =head1 SYNOPSIS
 
   use Gruntmaster::Daemon::Runner::Verifier;
-  Gruntmaster::Daemon::Runner::Verifier->run(5, $meta);
+  Gruntmaster::Daemon::Runner::Verifier::run(5, $meta);
 
 =head1 DESCRIPTION
 
This page took 0.021605 seconds and 4 git commands to generate.