forked from mattn/p5-Devel-CheckLib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,5 @@ t/dash-l-libs.t | |
t/headers.t | ||
t/inc/headerfile.h | ||
VMS-notes | ||
t/coverage.sh | ||
t/cmdline-LIBS-INC.t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
use strict; | ||
# compatible use warnings | ||
BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } } | ||
|
||
use lib 't/lib'; | ||
use IO::CaptureOutput qw(capture); | ||
use Config; | ||
|
||
use File::Spec; | ||
use Test::More; | ||
|
||
my($debug, $stdout, $stderr) = ($ENV{DEVEL_CHECKLIB_DEBUG} || 0); | ||
my $libdir; | ||
|
||
eval "use Devel::CheckLib"; | ||
if($@ =~ /Couldn't find your C compiler/) { #' | ||
plan skip_all => "Couldn't find your C compiler"; | ||
} | ||
|
||
eval "use Helper qw(create_testlib)"; | ||
if($libdir = create_testlib("bazbam")) { | ||
plan tests => 1; | ||
} else { | ||
plan skip_all => "Couldn't build a library to test against"; | ||
}; | ||
|
||
my $runtime = '-l'.( | ||
$^O eq 'MSWin32' # if Win32 (not Cygwin) ... | ||
? ( | ||
$Config{cc} =~ /(^|^\w+ )bcc/ | ||
? 'cc3250' # ... Borland | ||
: 'msvcrt' # ... otherwise assume Microsoft | ||
) | ||
: 'm' # default to Unix-style | ||
); | ||
|
||
my @args = (qq{LIBS=$runtime}); | ||
capture( | ||
sub { system( | ||
$Config{perlpath}, | ||
'-Mblib', | ||
'-MDevel::CheckLib', | ||
'-e', | ||
"print @ARGV;assert_lib(debug => $debug)", | ||
@args | ||
)}, | ||
\$stdout, | ||
\$stderr | ||
); | ||
is($stderr, q{}, join(', ', @args)) || diag("\tSTDOUT: $stdout\n\tSTDERR: $stderr\n"); | ||
|
||
@args = map { "LIBS=$_" } ($runtime, '-lbazbam', "-L$libdir"); | ||
capture( | ||
sub { system( | ||
$Config{perlpath}, | ||
'-Mblib', | ||
'-MDevel::CheckLib', | ||
'-e', | ||
"print @ARGV;assert_lib(debug => $debug)", | ||
@args | ||
)}, | ||
\$stdout, | ||
\$stderr | ||
); | ||
is($stderr, q{}, join(', ', @args)) || diag("\tSTDOUT: $stdout\n\tSTDERR: $stderr\n"); | ||
|
||
@args = (qq{LIBS="$runtime -lbazbam -L$libdir"}); | ||
capture( | ||
sub { system( | ||
$Config{perlpath}, | ||
'-Mblib', | ||
'-MDevel::CheckLib', | ||
'-e', | ||
"print @ARGV;assert_lib(debug => $debug)", | ||
@args | ||
)}, | ||
\$stdout, | ||
\$stderr | ||
); | ||
is($stderr, q{}, join(', ', @args)) || diag("\tSTDOUT: $stdout\n\tSTDERR: $stderr\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
# $Id: coverage.sh,v 1.1 2008/02/26 21:54:55 drhyde Exp $ | ||
|
||
cover -delete | ||
HARNESS_PERL_SWITCHES=-MDevel::Cover make test | ||
cover |