examples/script-covered
raw| 1 | #!/usr/bin/perl -w |
| 2 | use strict; |
| 3 | |
| 4 | my $file = shift || die "need something to test"; |
| 5 | my $code; |
| 6 | |
| 7 | open F, $file; |
| 8 | { |
| 9 | local $/; |
| 10 | $code = <F>; |
| 11 | } |
| 12 | close F; |
| 13 | |
| 14 | eval qq{ |
| 15 | package testme; |
| 16 | |
| 17 | $code; |
| 18 | |
| 19 | 1; |
| 20 | }; |
| 21 | $INC{'testme.pm'} = 1; |
| 22 | |
| 23 | print testme::foo(); |
| 24 | |
| 25 | require Pod::Coverage; |
| 26 | Pod::Coverage->import(pod_from => $file, |
| 27 | package => 'testme'); |