comparison Lib/IMPL/Test/Plan.pm @ 3:2e546a5175dd

in developing
author Sergey
date Tue, 11 Aug 2009 17:45:52 +0400
parents 03e58a454b20
children d59526f6310e
comparison
equal deleted inserted replaced
2:78cd38551534 3:2e546a5175dd
61 my @cache; 61 my @cache;
62 62
63 foreach my $Unit ($this->Units){ 63 foreach my $Unit ($this->Units){
64 my %info; 64 my %info;
65 65
66 # preload module
67 eval "require $Unit" unless (ref $Unit);
68
66 $info{Unit} = $Unit; 69 $info{Unit} = $Unit;
67 try { 70 try {
68 $info{Tests} = [map $Unit->new($_), $Unit->List]; 71 $info{Tests} = [map $Unit->new($_), $Unit->List];
69 } otherwise { 72 } otherwise {
70 $info{Tests} = [$info{Unit} = new IMPL::Test::BadUnit($Unit->UnitName,"Failed to extract tests",$@)]; 73 $info{Tests} = [$info{Unit} = new IMPL::Test::BadUnit($Unit->can('UnitName') ? $Unit->UnitName : $Unit,"Failed to extract tests",$@)];
71 }; 74 };
72 $count += @{$info{Tests}}; 75 $count += @{$info{Tests}};
73 push @cache, \%info if @{$info{Tests}}; 76 push @cache, \%info if @{$info{Tests}};
74 } 77 }
75 78