diff options
author | Brian Fraser <fraserbn@gmail.com> | 2013-05-19 04:44:07 -0300 |
---|---|---|
committer | Brian Fraser <fraserbn@gmail.com> | 2014-01-22 16:33:06 -0300 |
commit | 209fbbd21a9702a5ac89867ea51f329d34a14f7d (patch) | |
tree | 04b9dc78d1ce51cb978c5469325ce2b1d851b0ca /lib/ExtUtils/t | |
parent | bad5a428739969dda658b4f5768c98582da578f7 (diff) | |
download | perl-209fbbd21a9702a5ac89867ea51f329d34a14f7d.tar.gz |
lib/ExtUtils/t/Embed.t: Skip tests is cross-compiling and $Config{cc} is not available
Diffstat (limited to 'lib/ExtUtils/t')
-rw-r--r-- | lib/ExtUtils/t/Embed.t | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/ExtUtils/t/Embed.t b/lib/ExtUtils/t/Embed.t index 192c738629..c02640cd76 100644 --- a/lib/ExtUtils/t/Embed.t +++ b/lib/ExtUtils/t/Embed.t @@ -11,10 +11,12 @@ chdir 't'; use Config; use ExtUtils::Embed; use File::Spec; +use IPC::Cmd qw(can_run); -if ( $Config{'usecrosscompile'} ) { - print "1..0 # SKIP no toolchain installed when cross-compiling\n"; - exit 0; +my $cc = $Config{'cc'}; +if ( $Config{usecrosscompile} && !can_run($cc) ) { + print "1..0 # SKIP Cross-compiling and the target doesn't have $cc"; + exit; } open(my $fh,">embed_test.c") || die "Cannot open embed_test.c:$!"; print $fh <DATA>; @@ -22,7 +24,7 @@ close($fh); $| = 1; print "1..10\n"; -my $cc = $Config{'cc'}; + my $cl = ($^O eq 'MSWin32' && $cc eq 'cl'); my $skip_exe = $^O eq 'os2' && $Config{ldflags} =~ /(?<!\S)-Zexe\b/; my $exe = 'embed_test'; |