| 1 | package Jifty::Test::Dist; | ||||||||||
| 2 | |||||||||||
| 3 | 90 | ▶ | use FindBin; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 90 | ▶ | use File::Spec; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 90 | ▶ | use Cwd; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | our @post_chdir; | ||||||||||
| 8 | |||||||||||
| 9 | 90 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=3 SCAR=11.0
| |||||||||||
| 10 | 90 | $Jifty::Test::Dist::OrigCwd = Cwd::cwd; | |||||||||
| 11 | |||||||||||
| 12 | 90 | ▶ | @INC = grep { defined } map { ref($_) ? $_ : File::Spec->rel2abs($_) } @INC; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 90 | chdir "$FindBin::Bin/.."; | |||||||||
| 14 | |||||||||||
| 15 | # SetupWizard needs this to remove lingering site_config files before | ||||||||||
| 16 | # loading Jifty | ||||||||||
| 17 | 90 | for (@post_chdir) { $_->() } | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 90 | ▶ | use lib 'lib'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | 90 | ▶ | use base qw/Jifty::Test/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 22 | |||||||||||
| 23 | =head1 NAME | ||||||||||
| 24 | |||||||||||
| 25 | Jifty::Test::Dist - Tests in Jifty distributions inside of Jifty | ||||||||||
| 26 | |||||||||||
| 27 | =head1 SYNOPSIS | ||||||||||
| 28 | |||||||||||
| 29 | use Jifty::Test::Dist tests => 5; | ||||||||||
| 30 | |||||||||||
| 31 | =head1 DESCRIPTION | ||||||||||
| 32 | |||||||||||
| 33 | Jifty::Test::Dist is a utility wrapper around L<Jifty::Test>; it | ||||||||||
| 34 | changes the current working directory to be the one step above where | ||||||||||
| 35 | the test file is, so that Jifty will detect the correct application | ||||||||||
| 36 | root for the tests. | ||||||||||
| 37 | |||||||||||
| 38 | =cut | ||||||||||
| 39 | |||||||||||
| 40 | 1; | ||||||||||
| 41 | |||||||||||