| 1 | package Test::Unit::Setup; | ||
| 2 | BEGIN { | ||
| 3 | $Test::Unit::Setup::VERSION = '0.25_1325'; # added by dist-tools/SetVersion.pl | ||
| 4 | } | ||
| 5 | use strict; | ||
| 6 | |||
| 7 | use base qw(Test::Unit::Decorator); | ||
| 8 | |||
| 9 | sub run { | ||
| 10 | my $self = shift(); | ||
| 11 | my($result) = @_; | ||
| 12 | my $protectable = sub { | ||
| 13 | $self->set_up(); | ||
| 14 | $self->basic_run($result); | ||
| 15 | $self->tear_down(); | ||
| 16 | }; | ||
| 17 | $result->run_protected($self, $protectable); | ||
| 18 | } | ||
| 19 | |||
| 20 | # Sets up the fixture. Override to set up additional fixture | ||
| 21 | # state. | ||
| 22 | |||
| 23 | sub set_up { | ||
| 24 | print "Suite setup\n"; | ||
| 25 | } | ||
| 26 | |||
| 27 | # Tears down the fixture. Override to tear down the additional | ||
| 28 | # fixture state. | ||
| 29 | |||
| 30 | sub tear_down { | ||
| 31 | print "Suite teardown\n"; | ||
| 32 | } | ||
| 33 | |||
| 34 | 1; | ||
| 35 | __END__ |