Acme-Alien-DontPanic2

 view release on metacpan or  search on metacpan

t/00_diag.t  view on Meta::CPAN

  File::Temp
  Inline
  Inline::C
  Inline::CPP
  Module::Build
  Path::Tiny
  Test2::V0
  Test::Alien
);

$post_diag = sub {
  require Acme::Alien::DontPanic2;
  diag "version       = ", Acme::Alien::DontPanic2->version;
  diag "cflags        = ", Acme::Alien::DontPanic2->cflags;
  diag "cflags_static = ", Acme::Alien::DontPanic2->cflags_static;
  diag "libs          = ", Acme::Alien::DontPanic2->libs;
  diag "libs_static   = ", Acme::Alien::DontPanic2->libs_static;
  diag "bin_dir       = ", $_ for Acme::Alien::DontPanic2->bin_dir;
};

my @modules = sort keys %modules;

sub spacer ()
{
  diag '';
  diag '';
  diag '';
}

pass 'okay';

my $max = 1;
$max = $_ > $max ? $_ : $max for map { length $_ } @modules;
our $format = "%-${max}s %s";

spacer;

my @keys = sort grep /(MOJO|PERL|\A(LC|HARNESS)_|\A(SHELL|LANG)\Z)/i, keys %ENV;

if(@keys > 0)
{
  diag "$_=$ENV{$_}" for @keys;

  if($ENV{PERL5LIB})
  {
    spacer;
    diag "PERL5LIB path";
    diag $_ for split $Config{path_sep}, $ENV{PERL5LIB};

  }
  elsif($ENV{PERLLIB})
  {
    spacer;
    diag "PERLLIB path";
    diag $_ for split $Config{path_sep}, $ENV{PERLLIB};
  }

  spacer;
}

diag sprintf $format, 'perl', "$] $^O $Config{archname}";

foreach my $module (sort @modules)
{
  my $pm = "$module.pm";
  $pm =~ s{::}{/}g;
  if(eval { require $pm; 1 })
  {
    my $ver = eval { $module->VERSION };
    $ver = 'undef' unless defined $ver;
    diag sprintf $format, $module, $ver;
  }
  else
  {
    diag sprintf $format, $module, '-';
  }
}

if($post_diag)
{
  spacer;
  $post_diag->();
}

spacer;

done_testing;



( run in 0.864 second using v1.01-cache-2.11-cpan-5e09290becf )