HEX
Server: Apache
System: Linux server-634962.emtiyz.com 5.14.0-611.11.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Dec 3 09:47:37 EST 2025 x86_64
User: codo66ho (1003)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //home/.cpan/build/Devel-CheckLib-1.16-0/t/cmdline-LIBS-INC.t
use strict;
# compatible use warnings
BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } }

use lib 't/lib';
use Capture::Tiny 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 => 3;
} 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 $rval = undef;
my @args = (qq{LIBS=$runtime});
($stdout, $stderr) = capture {
    $rval = system(
        $Config{perlpath},
	'-Mblib',
	'-MDevel::CheckLib',
	'-e',
	"print @ARGV;assert_lib(debug => $debug)",
        @args
    );
};
ok($stderr eq '' && defined($rval) && $rval == 0, "linked OK: ".join(', ', @args)) || diag("\tSTDOUT: $stdout\n\tSTDERR: $stderr\n");

$rval = undef;
@args = map { "LIBS=$_" } ($runtime, '-lbazbam', "-L$libdir");
($stdout, $stderr) = capture {
    $rval = system(
        $Config{perlpath},
	'-Mblib',
	'-MDevel::CheckLib',
	'-e',
	"print @ARGV;assert_lib(debug => $debug)",
        @args
    );
};
ok($stderr eq '' && defined($rval) && $rval == 0, "linked OK: ".join(', ', @args)) || diag("\tSTDOUT: $stdout\n\tSTDERR: $stderr\n");

$rval = undef;
@args = (qq{"LIBS=$runtime -lbazbam -L$libdir"});
($stdout, $stderr) = capture {
    $rval = system(
        $Config{perlpath},
	'-Mblib',
	'-MDevel::CheckLib',
	'-e',
	"print @ARGV;assert_lib(debug => $debug)",
        @args
    );
};
ok($stderr eq '' && defined($rval) && $rval == 0, "linked OK: ".join(', ', @args)) || diag("\tSTDOUT: $stdout\n\tSTDERR: $stderr\n");