File Coverage

blib/lib/Test/Functional/Conf.pm
Criterion Covered Total %
statement 16 19 84.2
branch 0 2 0.0
condition n/a
subroutine 7 7 100.0
pod 2 2 100.0
total 25 30 83.3


line stmt bran cond sub pod time code
1             package Test::Functional::Conf;
2              
3 3     3   20 use warnings FATAL => 'all';
  3         6  
  3         310  
4 3     3   21 use strict;
  3         5  
  3         163  
5              
6             our $VERSION = '0.06';
7              
8 3     3   16 use Carp;
  3         7  
  3         391  
9 3     3   17 use Exporter;
  3         5  
  3         703  
10              
11             my %SETTINGS = (
12             unstable => 0,
13             fastout => 0,
14             );
15              
16             sub import {
17 3     3   11 my ($class, @args) = @_;
18 3         87 for(my $i=0; $i < scalar(@args); $i += 2) {
19 0         0 my ($key, $value) = @args[$i,$i + 1];
20 0 0       0 croak "invalid setting '$key'" unless exists($SETTINGS{$key});
21 0         0 $SETTINGS{$key} = $value;
22             }
23             }
24              
25 3     3 1 15 sub unstable { return $SETTINGS{unstable} }
26 3     3 1 14 sub fastout { return $SETTINGS{fastout} }
27              
28             =head1 NAME
29              
30             Test::Functional::Conf - Run-time configure for Test::Functional
31              
32             =head1 SYNOPSIS
33              
34             # run extra "in-development" tests
35             perl -MTest::Functional::Conf=unstable,1 some-test.t
36              
37             # stop at first test failure
38             perl -MTest::Functional::Conf=fastout,1 some-test.t
39              
40             # find first test failure (including unstable tests)
41             perl -MTest::Functional::Conf=fastout,1,unstable,1 some-test.t
42              
43             =head1 DESCRIPTION
44              
45             This package's only function is to allow a user to toggle various modes of
46             Test::Functional. The synopsis provides the general idea. The specific features
47             that are currently available are:
48              
49             =over
50              
51             =item * unstable (boolean): run test which are under construction (signified by
52             using I rather than I.
53              
54             =item * fastout (boolean): halt the test at the first failure.
55              
56             =back
57              
58             For more information, see L.
59              
60             =head1 AUTHOR
61              
62             Erik Osheim C<< >>
63              
64             =head1 COPYRIGHT & LICENSE
65              
66             Copyright 2009 Erik Osheim, all rights reserved.
67              
68             This program is free software; you can redistribute it and/or modify it
69             under the same terms as Perl itself.
70              
71             =cut
72              
73             1;