new diagnostic

This commit is contained in:
Graham Ollis
2013-09-28 12:36:00 -04:00
parent e955bb151a
commit 3ca192cd4f
4 changed files with 80 additions and 3 deletions

View File

@@ -1,11 +1,13 @@
use strict;
use warnings;
use Test::More tests => 1;
use Test::More;
use Mojo::IOLoop;
our $format;
my $loop = eval { Mojo::IOLoop->singleton };
diag $@ if $@;
ok $loop;
diag ref eval { $loop->reactor };
diag sprintf $format, 'mojo io loop', ref eval { $loop->reactor };
diag $@ if $@;
1;

51
t/00_diag.t Normal file
View File

@@ -0,0 +1,51 @@
use strict;
use warnings;
use Test::More tests => 1;
BEGIN { eval q{ use EV } }
eval q{
use FindBin ();
use File::Spec;
1;
} || die $@;
pass 'okay';
my @modules;
do {
my $fh;
open($fh, '<', File::Spec->catfile($FindBin::Bin, '00_diag.txt'));
@modules = <$fh>;
close $fh;
chomp @modules;
};
my $max = 1;
$max = $_ > $max ? $_ : $max for map { length $_ } @modules;
our $format = "%-${max}s %s";
diag '';
diag '';
diag '';
diag sprintf $format, 'perl ', $^V;
require(File::Spec->catfile($FindBin::Bin, '00_diag.pl'))
if -e File::Spec->catfile($FindBin::Bin, '00_diag.pl');
foreach my $module (@modules)
{
if(eval qq{ use $module; 1 })
{
my $ver = eval qq{ \$$module\::VERSION };
$ver = 'undef' unless defined $ver;
diag sprintf $format, $module, $ver;
}
else
{
diag sprintf $format, $module, '-';
}
}
diag '';
diag '';
diag '';

24
t/00_diag.txt Normal file
View File

@@ -0,0 +1,24 @@
Carp
Cwd
EV
ExtUtils::MakeMaker
File::Spec
File::Temp
FindBin
IO::Handle
IPC::Open3
Mojo::Base
Mojo::ByteStream
Mojo::IOLoop
Mojolicious
Mojolicious::Lite
Mojolicious::Plugin
POSIX
Scalar::Util
Template
Template::Provider
Test::CPAN::Meta
Test::Mojo
Test::More
lib
utf8