Test-Unit-Lite
view release on metacpan or search on metacpan
lib/Test/Unit/Lite.pm view on Meta::CPAN
our $VERSION = $Test::Unit::Lite::VERSION;
our %Seen_Refs = ();
our @Data_Stack;
my $DNE = bless [], 'Does::Not::Exist';
sub new {
my ($class) = @_;
$class = ref $class if ref $class;
my $self = {};
return bless $self => $class;
}
sub set_up { }
sub tear_down { }
sub list_tests {
my ($self) = @_;
my $class = ref $self || $self;
lib/Test/Unit/Lite.pm view on Meta::CPAN
sub new {
my ($class) = @_;
my $self = {
'messages' => [],
'errors' => 0,
'failures' => 0,
'passes' => 0,
};
return bless $self => $class;
}
sub messages {
my ($self) = @_;
return $self->{messages};
}
sub errors {
my ($self) = @_;
return $self->{errors};
lib/Test/Unit/Lite.pm view on Meta::CPAN
package Test::Unit::TestSuite;
our $VERSION = $Test::Unit::Lite::VERSION;
sub empty_new {
my ($class, $name) = @_;
my $self = {
'name' => defined $name ? $name : 'Test suite',
'units' => [],
};
return bless $self => $class;
}
sub new {
my ($class, $test) = @_;
my $self = {
'name' => 'Test suite',
'units' => [],
};
lib/Test/Unit/Lite.pm view on Meta::CPAN
}
elsif (defined $test and $test->isa('Test::Unit::TestCase')) {
$class = ref $test ? ref $test : $test;
$self->{units} = [ $test ];
}
else {
require Carp;
Carp::croak(sprintf("usage: %s->new([CLASSNAME | TEST])\n", __PACKAGE__));
}
return bless $self => $class;
}
sub name {
return $_[0]->{name};
}
sub units {
return $_[0]->{units};
}
lib/Test/Unit/Lite.pm view on Meta::CPAN
my ($class, $fh_out, $fh_err) = @_;
$fh_out = \*STDOUT unless defined $fh_out;
$fh_err = \*STDERR unless defined $fh_err;
_autoflush($fh_out);
_autoflush($fh_err);
my $self = {
'suite' => undef,
'fh_out' => $fh_out,
'fh_err' => $fh_err,
};
return bless $self => $class;
}
sub fh_out {
my ($self) = @_;
return $self->{fh_out};
}
sub fh_err {
my ($self) = @_;
return $self->{fh_err};
( run in 0.317 second using v1.01-cache-2.11-cpan-65fba6d93b7 )