Skip to content
This repository has been archived by the owner on Mar 7, 2019. It is now read-only.

skip inline* tests when Acme::Alien::DontPanic has an obviously bad dist_dir #108

Merged
merged 3 commits into from Feb 21, 2015
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/Alien/Base.pm
Expand Up @@ -114,6 +114,8 @@ sub import {
my $class = shift;

return if $class->install_type('system');

$class->dist_dir;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to add a comment on why this line is called here (e.g., "Sanity check in order to ensure that dist_dir can be found. This will throw an exception otherwise.")


# get a reference to %Alien::MyLibrary::AlienLoaded
# which contains names of already loaded libraries
Expand Down Expand Up @@ -179,6 +181,9 @@ sub dist_dir {
? File::ShareDir::dist_dir($dist)
: $class->config('working_directory');

croak "Failed to find share dir for dist '$dist'"
unless -d $dist_dir;

return $dist_dir;
}

Expand Down
2 changes: 1 addition & 1 deletion t/inline.t
Expand Up @@ -4,7 +4,7 @@ use Test::More;

BEGIN {
eval q{ use Inline 0.56 (); require Inline::C; } || plan skip_all => 'test requires Inline 0.56 and Inline::C';
eval q{ use Acme::Alien::DontPanic 0.010; 1 } || plan skip_all => 'test requires Acme::Alien::DontPanic 0.010' . $@;
eval q{ use Acme::Alien::DontPanic 0.010; 1 } || plan skip_all => 'test requires Acme::Alien::DontPanic 0.010 :' . $@;
plan skip_all => 'test requires that Acme::Alien::DontPanic was build with Alien::Base 0.006'
unless defined Acme::Alien::DontPanic->Inline("C")->{AUTO_INCLUDE};
}
Expand Down
2 changes: 1 addition & 1 deletion t/inline_cpp.t
Expand Up @@ -4,7 +4,7 @@ use Test::More;

BEGIN {
eval q{ use Inline 0.56 (); require Inline::CPP; } || plan skip_all => 'test requires Inline 0.56 and Inline::CPP';
eval q{ use Acme::Alien::DontPanic 0.010; 1 } || plan skip_all => 'test requires Acme::Alien::DontPanic 0.010';
eval q{ use Acme::Alien::DontPanic 0.010; 1 } || plan skip_all => 'test requires Acme::Alien::DontPanic 0.010 :' . $@;
plan skip_all => 'test requires that Acme::Alien::DontPanic was build with Alien::Base 0.006'
unless defined Acme::Alien::DontPanic->Inline("CPP")->{AUTO_INCLUDE};
}
Expand Down