Changeset 237
- Timestamp:
- 04/24/06 11:30:22 (18 years ago)
- Location:
- trunk/soft/ObsData
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/soft/ObsData/ObsData.pm
r229 r237 101 101 } 102 102 103 $self->load_plugins() ;103 $self->load_plugins() or return 0; 104 104 105 105 return 1; … … 134 134 $datatype, 135 135 ); 136 exit(1);136 return 0; 137 137 } 138 138 my $sub = do $plugfilename; 139 if ($@) { 140 $self->logging(4, 141 "Cannot load plugin %s for %s: %s, exiting !", 142 $plugin, 143 $datatype, 144 $@, 145 ); 146 return 0; 147 } 139 148 if ($sub && ref $sub eq 'CODE') { 140 149 $self->{plugin}{$datatype}{$plugin} = { … … 158 167 } 159 168 } 169 return 1; 160 170 } 161 171 -
trunk/soft/ObsData/t/O-01.t
r169 r237 4 4 use warnings; 5 5 6 use Test::More tests => 4;6 use Test::More tests => 6; 7 7 8 8 use_ok('ObsData'); … … 12 12 ok(!ObsData->new('testdata/wrongfile'), "Return an error on bad file"); 13 13 ok(!ObsData->new(undef), "Return an error w/o a config file"); 14 15 ok(my $o = ObsData->new('testdata/obsdata-conf-wrongplugin'), "Can get an Obsdata object"); 16 ok(!$o->load(), "load() return an error if an invalid plugiin is found");
Note: See TracChangeset
for help on using the changeset viewer.