1 package Test::Valgrind::Component;
8 Test::Valgrind::Component - Base class for Test::Valgrind components.
16 our $VERSION = '1.18';
20 This class is the base for all others that act as components that can be started and stopped.
26 use base qw<Test::Valgrind::Carp>;
32 my $tvc = Test::Valgrind::Component->new;
42 if (Scalar::Util::blessed($self)) {
44 if ($self->isa(__PACKAGE__)) {
45 $self->{started} = undef;
59 Specifies whether the component is running (C<1>), stopped (C<0>) or was never started (C<undef>).
63 sub started { @_ <= 1 ? $_[0]->{started} : ($_[0]->{started} = $_[1] ? 1 : 0) }
69 Marks the component as started, and throws an exception if it was already.
70 Returns its self object.
77 $self->_croak(ref($self) . ' component already started') if $self->started;
87 Marks the component as stopped, and throws an exception if it wasn't started.
88 Returns its self object.
95 $self->_croak(ref($self) . ' component is not started') unless $self->started;
107 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
109 You can contact me by mail or on C<irc.perl.org> (vincent).
113 Please report any bugs or feature requests to C<bug-test-valgrind at rt.cpan.org>, or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Valgrind>.
114 I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
118 You can find documentation for this module with the perldoc command.
120 perldoc Test::Valgrind::Component
122 =head1 COPYRIGHT & LICENSE
124 Copyright 2009,2010,2011,2013,2015 Vincent Pit, all rights reserved.
126 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
130 1; # End of Test::Valgrind::Component