| 1 | use strictscip-perl cpan CPAN-Reporter-Smoker 0.30 strict/; |
| 2 | use warningsscip-perl cpan CPAN-Reporter-Smoker 0.30 warnings/; |
| 3 | |
| 4 | use Test::Morescip-perl cpan CPAN-Reporter-Smoker 0.30 Test/More/; |
| 5 | |
| 6 | use Configscip-perl cpan CPAN-Reporter-Smoker 0.30 Config/; |
| 7 | use File::Specscip-perl cpan CPAN-Reporter-Smoker 0.30 File/Spec/; |
| 8 | use IO::CaptureOutputscip-perl cpan CPAN-Reporter-Smoker 0.30 IO/CaptureOutput/ qw/capture/; |
| 9 | use libscip-perl cpan CPAN-Reporter-Smoker 0.30 lib/ 't/lib'; |
| 10 | use DotDirsscip-perl cpan CPAN-Reporter-Smoker 0.30 DotDirs/; |
| 11 | |
| 12 | planscip-perl cpan CPAN-Reporter-Smoker 0.30 main/plan(). tests => 7 ; |
| 13 | |
| 14 | #--------------------------------------------------------------------------# |
| 15 | # Setup test environment |
| 16 | #--------------------------------------------------------------------------# |
| 17 | |
| 18 | # Setup CPAN::Reporter configuration and add mock lib path to @INC |
| 19 | $ENVscip-perl cpan CPAN-Reporter-Smoker 0.30 main/`%ENV`.{PERL_CPAN_REPORTER_DIR} = DotDirs->prepare_cpan_reporterscip-perl cpan CPAN-Reporter-Smoker 0.30 DotDirs/prepare_cpan_reporter().; |
| 20 | |
| 21 | # Setup CPAN dotdir with custom CPAN::MyConfig |
| 22 | DotDirs->prepare_cpanscip-perl cpan CPAN-Reporter-Smoker 0.30 DotDirs/prepare_cpan().; |
| 23 | |
| 24 | my ($stdout, $stderr); |
| 25 | |
| 26 | my @list = qw( |
| 27 | DAGOLDEN/Bogus-Pass-0.01.tar.gz |
| 28 | DAGOLDEN/Bogus-Fail-0.01.tar.gz |
| 29 | ); |
| 30 | |
| 31 | #--------------------------------------------------------------------------# |
| 32 | # tests begin here |
| 33 | #--------------------------------------------------------------------------# |
| 34 | |
| 35 | require_okscip-perl cpan CPAN-Reporter-Smoker 0.30 main/require_ok().( 'CPAN::Reporter::Smoker' ); |
| 36 | |
| 37 | can_okscip-perl cpan CPAN-Reporter-Smoker 0.30 main/can_ok().( 'CPAN::Reporter::Smoker', 'start' ); |
| 38 | |
| 39 | passscip-perl cpan CPAN-Reporter-Smoker 0.30 main/pass(). ("Starting simulated smoke testing"); |
| 40 | |
| 41 | local $ENVscip-perl cpan CPAN-Reporter-Smoker 0.30 main/`%ENV`.{PERL_CR_SMOKER_RUNONCE} = 1; |
| 42 | |
| 43 | my @args = ( list => \@list, 'reverse' => 1 ); |
| 44 | my ($ran_ok); |
| 45 | if ( ( $ENVscip-perl cpan CPAN-Reporter-Smoker 0.30 main/`%ENV`.{PERL_AUTHOR_TESTING} || "" ) eq 'DAGOLDEN' ) { |
| 46 | CPAN::Reporter::Smoker::startscip-perl cpan CPAN-Reporter-Smoker 0.30 CPAN/Reporter/Smoker/start().( @args ); |
| 47 | } |
| 48 | else { |
| 49 | $ran_ok = eval { |
| 50 | capture sub { |
| 51 | CPAN::Reporter::Smoker::startscip-perl cpan CPAN-Reporter-Smoker 0.30 CPAN/Reporter/Smoker/start().( @args ) |
| 52 | } => \$stdout, \$stderr; |
| 53 | 1; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | okscip-perl cpan CPAN-Reporter-Smoker 0.30 main/ok().( $ran_ok, "Finished simulated smoke testing" ) or diagscip-perl cpan CPAN-Reporter-Smoker 0.30 main/diag(). $@scip-perl cpan CPAN-Reporter-Smoker 0.30 main/`$@`.; |
| 58 | my $regex = joinscip-perl cpan CPAN-Reporter-Smoker 0.30 main/join().( ".+?", mapscip-perl cpan CPAN-Reporter-Smoker 0.30 main/map(). { quotemetascip-perl cpan CPAN-Reporter-Smoker 0.30 main/quotemeta(). } reversescip-perl cpan CPAN-Reporter-Smoker 0.30 main/reverse(). @list ); |
| 59 | likescip-perl cpan CPAN-Reporter-Smoker 0.30 main/like().( $stdout, qr/$regex/ms, "saw dists in correct order" ) or diagscip-perl cpan CPAN-Reporter-Smoker 0.30 main/diag(). $stdout; |
| 60 | |
| 61 | require_okscip-perl cpan CPAN-Reporter-Smoker 0.30 main/require_ok().( 'CPAN::Reporter::History' ); |
| 62 | my @results = CPAN::Reporter::History::have_testedscip-perl cpan CPAN-Reporter-Smoker 0.30 CPAN/Reporter/History/have_tested().(); |
| 63 | isscip-perl cpan CPAN-Reporter-Smoker 0.30 main/is().( scalarscip-perl cpan CPAN-Reporter-Smoker 0.30 main/scalar(). @results, scalarscip-perl cpan CPAN-Reporter-Smoker 0.30 main/scalar(). @list, "Number of reports in history" ); |
| 64 |