Update documentation and version
authorMarius Gavrilescu <marius@ieval.ro>
Fri, 31 Jan 2014 21:53:54 +0000 (23:53 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Fri, 31 Jan 2014 21:53:54 +0000 (23:53 +0200)
lib/Gruntmaster/Daemon.pm
lib/Gruntmaster/Daemon/Constants.pm
lib/Gruntmaster/Daemon/Format.pm
lib/Gruntmaster/Daemon/Generator/File.pm
lib/Gruntmaster/Daemon/Generator/Run.pm
lib/Gruntmaster/Daemon/Generator/Undef.pm
lib/Gruntmaster/Daemon/Judge/Absolute.pm
lib/Gruntmaster/Daemon/Judge/Points.pm
lib/Gruntmaster/Daemon/Runner/File.pm
lib/Gruntmaster/Daemon/Runner/Interactive.pm
lib/Gruntmaster/Daemon/Runner/Verifier.pm

index a4d1902b0cfa6fb9f36e196ea976da3a863996e6..f2b1edec8426b14d0df6f2ee612f04758e7e1fbe 100644 (file)
@@ -4,7 +4,7 @@ use 5.014000;
 use strict;
 use warnings;
 
 use strict;
 use warnings;
 
-our $VERSION = '0.001';
+our $VERSION = '5999-TRIAL';
 
 use Gruntmaster::Daemon::Constants qw/ERR/;
 use Gruntmaster::Daemon::Format qw/prepare_files/;
 
 use Gruntmaster::Daemon::Constants qw/ERR/;
 use Gruntmaster::Daemon::Format qw/prepare_files/;
@@ -139,48 +139,32 @@ sub run{
 
 1;
 __END__
 
 1;
 __END__
-# Below is stub documentation for your module. You'd better edit it!
 
 =head1 NAME
 
 
 =head1 NAME
 
-Gruntmaster::Daemon - Perl extension for blah blah blah
+Gruntmaster::Daemon - Gruntmaster 6000 Online Judge -- daemon
 
 =head1 SYNOPSIS
 
   use Gruntmaster::Daemon;
 
 =head1 SYNOPSIS
 
   use Gruntmaster::Daemon;
-  blah blah blah
+  Gruntmaster::Daemon->run;
 
 =head1 DESCRIPTION
 
 
 =head1 DESCRIPTION
 
-Stub documentation for Gruntmaster::Daemon, created by h2xs. It looks like the
-author of the extension was negligent enough to leave the stub
-unedited.
-
-Blah blah blah.
-
-
-=head1 SEE ALSO
-
-Mention other useful documentation such as the documentation of
-related modules or operating system documentation (such as man pages
-in UNIX), or any relevant external documentation such as RFCs or
-standards.
-
-If you have a mailing list set up for your module, mention it here.
-
-If you have a web site set up for your module, mention it here.
+Gruntmaster::Daemon is the daemon component of the Gruntmaster 6000 online judge.
 
 =head1 AUTHOR
 
 
 =head1 AUTHOR
 
-Marius Gavrilescu, E<lt>marius@E<gt>
+Marius Gavrilescu E<lt>marius@ieval.roE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2013 by Marius Gavrilescu
+Copyright (C) 2014 by Marius Gavrilescu
 
 
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself, either Perl version 5.18.1 or,
-at your option, any later version of Perl 5 you may have available.
+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
 
 
 =cut
index 189aabeae21a9a3a0026acaab14c872c2bcc80e4..5117cdd1a65beeec6ee646328fe84e3525e5253f 100644 (file)
@@ -5,7 +5,7 @@ use strict;
 use warnings;
 use parent qw/Exporter/;
 
 use warnings;
 use parent qw/Exporter/;
 
-our $VERSION = '0.001';
+our $VERSION = "5999-TRIAL";
 
 use constant +{
   # Accepted
 
 use constant +{
   # Accepted
@@ -24,3 +24,61 @@ use constant +{
 };
 
 our @EXPORT_OK = qw/AC ERR WA NZX TLE OLE DIED REJ/;
 };
 
 our @EXPORT_OK = qw/AC ERR WA NZX TLE OLE DIED REJ/;
+
+1;
+__END__
+
+=encoding utf-8
+
+=head1 NAME
+
+Gruntmaster::Daemon::Constants - Constants for the Gruntmaster daemon
+
+=head1 SYNOPSIS
+
+  use Gruntmaster::Daemon::Constants qw/WA NZX/;
+  ...
+  return [NZX, 'Non-zero exit status'] if $status;
+  return [WA, 'Wrong answer'] unless is_correct($answer);
+
+=head1 DESCRIPTION
+
+Gruntmaster::Daemon::Constants provides constants which are used in more than one module.
+
+The constants are:
+
+=over
+
+=item B<AC> The 'Accepted' job result.
+
+=item B<ERR> The 'Internal server error' job result.
+
+=item B<WA> The 'Wrong answer' job result.
+
+=item B<NZX> The 'Non-zero exit status' job result.
+
+=item B<TLE> The 'Time limit exceeded' job result.
+
+=item B<OLE> The 'Output limit exceeded' job result.
+
+=item B<DIED> The 'Crash' job result. Used when a program is killed by a signal.
+
+=item B<REJ> The 'Rejected' job result. Used when none of the above is appropriate.
+
+=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 3c0a84ed059ce6d87260a89f013ed80e62137ef6..86c194ab3866b8876601acd5c41dd04dc78fb578 100644 (file)
@@ -13,7 +13,7 @@ use Time::HiRes qw/alarm/;
 use List::MoreUtils qw/natatime/;
 use IPC::Signal qw/sig_name sig_num/;
 
 use List::MoreUtils qw/natatime/;
 use IPC::Signal qw/sig_name sig_num/;
 
-our $VERSION = '0.001';
+our $VERSION = "5999-TRIAL";
 our @EXPORT_OK = qw/prepare_files/;
 
 ##################################################
 our @EXPORT_OK = qw/prepare_files/;
 
 ##################################################
@@ -91,4 +91,55 @@ sub prepare_files{
        }
 }
 
        }
 }
 
-1
+1;
+__END__
+
+=encoding utf-8
+
+=head1 NAME
+
+Gruntmaster::Daemon::Format - Utility functions for handling source files
+
+=head1 SYNOPSIS
+
+  use Gruntmaster::Daemon::Format qw/prepare_files/;
+  prepare_files { files => {
+    prog => {
+      name => 'prog.pl',
+      format => 'PERL',
+      content => 'print "Hello, world!"'
+    },
+    ver => {
+      name => 'ver.cpp',
+      format => 'CPP',
+      content => ...
+    },
+  }};
+
+=head1 DESCRIPTION
+
+Gruntmaster::Daemon::Format exports utility functions for handling source files.
+
+=over
+
+=item B<prepare_files> I<$meta>
+
+Compiles all the source files in C<< $meta->{files} >>.
+
+=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 0531def67a1e45783f2602e25ba0cb41ef857b0b..5a809ebd8e1ae9b077421582f6eb5066482d6456 100644 (file)
@@ -7,7 +7,7 @@ use warnings;
 use File::Slurp qw/write_file/;
 use Log::Log4perl qw/get_logger/;
 
 use File::Slurp qw/write_file/;
 use Log::Log4perl qw/get_logger/;
 
-our $VERSION = '0.001';
+our $VERSION = "5999-TRIAL";
 
 ##################################################
 
 
 ##################################################
 
@@ -17,4 +17,36 @@ sub generate{
   write_file 'input', $meta->{infile}[$test - 1]
 }
 
   write_file 'input', $meta->{infile}[$test - 1]
 }
 
-1
+1;
+__END__
+
+=encoding utf-8
+
+=head1 NAME
+
+Gruntmaster::Daemon::Generator::File - Generate tests from files
+
+=head1 SYNOPSIS
+
+  use Gruntmaster::Daemon::Generator::File;
+  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] >>.
+
+=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 54e11186530ee674bb73d7a02bf0a077df88d5f3..b3e0e4e219fb6bf4d0b7d798c1b938efac4a6868 100644 (file)
@@ -17,4 +17,36 @@ sub generate{
   $gen->{run}->($gen->{name}, args => [ $test ], fds => [qw/1 >input/]);
 }
 
   $gen->{run}->($gen->{name}, args => [ $test ], fds => [qw/1 >input/]);
 }
 
-1
+1;
+__END__
+
+=encoding utf-8
+
+=head1 NAME
+
+Gruntmaster::Daemon::Generator::Run - Generate tests from program output
+
+=head1 SYNOPSIS
+
+  use Gruntmaster::Daemon::Generator::Run;
+  Gruntmaster::Daemon::Generator::Run->generate(5, $meta);
+
+=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>.
+
+=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 836a4be617e2ed3f8afe4220d7ed1f61ee70548e..7ccb887626de1ca769ca1a0d2b83cdf29f0fa800 100644 (file)
@@ -6,7 +6,7 @@ use warnings;
 
 use Log::Log4perl qw/get_logger/;
 
 
 use Log::Log4perl qw/get_logger/;
 
-our $VERSION = '0.001';
+our $VERSION = "5999-TRIAL";
 
 ##################################################
 
 
 ##################################################
 
@@ -14,4 +14,36 @@ sub generate{
   get_logger->trace("Pretending to generate test $_[0]...");
 }
 
   get_logger->trace("Pretending to generate test $_[0]...");
 }
 
-1
+1;
+__END__
+
+=encoding utf-8
+
+=head1 NAME
+
+Gruntmaster::Daemon::Generator::Undef - Pretend to generate tests
+
+=head1 SYNOPSIS
+
+  use Gruntmaster::Daemon::Generator::Undef;
+  Gruntmaster::Daemon::Generator::Undef->generate(5, $meta);
+
+=head1 DESCRIPTION
+
+Gruntmaster::Daemon::Generator::Undef is a noop test generator. It is useful for L<interactive|Gruntmaster::Daemon::Runner::Interactive> problems, where there is no input.
+
+=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 2adea012f76875550b649d3a9e909c74061612bc..f6792c3dbeedea6a09d92f459633bf7d4a3c0f20 100644 (file)
@@ -6,7 +6,7 @@ use warnings;
 
 use Gruntmaster::Daemon::Constants qw/AC/;
 
 
 use Gruntmaster::Daemon::Constants qw/AC/;
 
-our $VERSION = '0.001';
+our $VERSION = '5999-TRIAL';
 
 ##################################################
 
 
 ##################################################
 
index e75aeb2536c3bb566b294c3eeea118f2726b966f..6e6563b4baad6e3b0d784556b967a069d0f25b84 100644 (file)
@@ -7,7 +7,8 @@ use warnings;
 use Gruntmaster::Daemon::Constants qw/AC REJ/;
 use List::Util qw/sum/;
 use Log::Log4perl qw/get_logger/;
 use Gruntmaster::Daemon::Constants qw/AC REJ/;
 use List::Util qw/sum/;
 use Log::Log4perl qw/get_logger/;
-our $VERSION = '0.001';
+
+our $VERSION = '5999-TRIAL';
 
 ##################################################
 
 
 ##################################################
 
index 50f51868e2e199cd6a6045e00a5051fe4ae00d2f..00d38fd010564fc116d75865b1bf9a2728ac5215 100644 (file)
@@ -8,6 +8,8 @@ use Gruntmaster::Daemon::Constants qw/WA/;
 use File::Slurp qw/slurp/;
 use Log::Log4perl qw/get_logger/;
 
 use File::Slurp qw/slurp/;
 use Log::Log4perl qw/get_logger/;
 
+our $VERSION = "5999-TRIAL";
+
 ##################################################
 
 sub run{
 ##################################################
 
 sub run{
@@ -28,4 +30,36 @@ sub run{
   $meta->{tests}[$test - 1] // 0
 }
 
   $meta->{tests}[$test - 1] // 0
 }
 
-1
+1;
+__END__
+
+=encoding utf-8
+
+=head1 NAME
+
+Gruntmaster::Daemon::Runner::File - Compare output with static text files
+
+=head1 SYNOPSIS
+
+  use Gruntmaster::Daemon::Runner::File;
+  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.
+
+=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 9c4580fbf2e033f77eabf0f9ddecb789467d8c6a..2d2fe91cbe800be381aa8a681875c8674bc3f5ca 100644 (file)
@@ -10,6 +10,8 @@ use Log::Log4perl qw/get_logger/;
 use POSIX qw/mkfifo/;
 use Try::Tiny;
 
 use POSIX qw/mkfifo/;
 use Try::Tiny;
 
+our $VERSION = '5999-TRIAL';
+
 ##################################################
 
 sub run{
 ##################################################
 
 sub run{
@@ -36,5 +38,4 @@ sub run{
   scalar slurp 'result'
 }
 
   scalar slurp 'result'
 }
 
-1;
-__END__
+1
index 5a0b5ed5d9bb789e8263c658e8124e3fb15b44b2..070fd0a9b1d4057ff785e2a77a7431d8f390fbad 100644 (file)
@@ -9,6 +9,8 @@ use File::Slurp qw/slurp/;
 use Log::Log4perl qw/get_logger/;
 use Try::Tiny;
 
 use Log::Log4perl qw/get_logger/;
 use Try::Tiny;
 
+our $VERSION = '5999-TRIAL';
+
 ##################################################
 
 sub run{
 ##################################################
 
 sub run{
@@ -24,4 +26,38 @@ sub run{
   scalar slurp 'result';
 }
 
   scalar slurp 'result';
 }
 
-1
+1;
+__END__
+
+=encoding utf-8
+
+=head1 NAME
+
+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);
+
+=head1 DESCRIPTION
+
+Gruntmaster::Daemon::Runner::Verifier is a runner which uses a verifier program to check the correctness of the output.
+
+The verifier program, C<< $meta->{files}{ver} >>, reads the test input from stdin and the output from fd 3. If the output is incorrect, it should return a nonzero value. Otherwise, it should print the score on this test and then return 0.
+
+=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
This page took 0.023132 seconds and 4 git commands to generate.