Add some uncoverable directives
[gruntmaster-daemon.git] / lib / Gruntmaster / Daemon / Generator / File.pm
CommitLineData
5c5cd38a
MG
1package Gruntmaster::Daemon::Generator::File;
2
3use 5.014000;
4use strict;
5use warnings;
6
8a8d1a82 7use File::Copy qw/copy/;
ab436d78 8use File::Slurp qw/write_file/;
5c5cd38a
MG
9use Log::Log4perl qw/get_logger/;
10
99d37110 11our $VERSION = '5999.000_004';
5c5cd38a
MG
12
13##################################################
14
15sub generate{
a722431b
MG
16 my ($test, $meta) = @_;
17 get_logger->trace("Generating test $test ...");
146dc3a7 18 if (exists $meta->{infile}) { # uncoverable branch false
a722431b
MG
19 write_file 'input', $meta->{infile}[$test - 1]
20 } else {
146dc3a7 21 copy "/var/lib/gruntmasterd/pb/$meta->{problem}/$test.in", 'input' # uncoverable statement
a722431b 22 }
5c5cd38a
MG
23}
24
bc372959
MG
251;
26__END__
27
28=encoding utf-8
29
30=head1 NAME
31
32Gruntmaster::Daemon::Generator::File - Generate tests from files
33
34=head1 SYNOPSIS
35
36 use Gruntmaster::Daemon::Generator::File;
0005d3ad 37 Gruntmaster::Daemon::Generator::File::generate(5, $meta);
bc372959
MG
38
39=head1 DESCRIPTION
40
0005d3ad
MG
41Gruntmaster::Daemon::Generator::File is a static test generator.
42If C<< $meta->{infile} >> exists, the input for test C<$i> is C<< $meta->{infile}[$i - 1] >>.
43Otherwise, the input for test C<$i> is F<< /var/lib/gruntmasterd/pb/$meta->{problem}/$test.in >>.
bc372959
MG
44
45=head1 AUTHOR
46
47Marius Gavrilescu E<lt>marius@ieval.roE<gt>
48
49=head1 COPYRIGHT AND LICENSE
50
51Copyright (C) 2014 by Marius Gavrilescu
52
53This library is free software: you can redistribute it and/or modify
54it under the terms of the GNU Affero General Public License as published by
55the Free Software Foundation, either version 3 of the License, or
56(at your option) any later version.
57
58
59=cut
This page took 0.021315 seconds and 4 git commands to generate.