File: dep_no_inherit_vars.t

package info (click to toggle)
libpkgconfig-perl 0.26026-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,912 kB
  • sloc: ansic: 6,120; perl: 1,922; makefile: 4; sh: 3
file content (26 lines) | stat: -rw-r--r-- 899 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use strict;
use warnings;
use Test::More;
use FindBin ();

BEGIN {
$ENV{PKG_CONFIG_PATH} = "$FindBin::Bin/data/dep_no_inherit_vars/lib/pkgconfig";
$ENV{PKG_CONFIG_PATH} =~ s{\\}{/}g;
}

require PkgConfig;
note "PKG_CONFIG_PATH = $ENV{PKG_CONFIG_PATH}";
note "PkgConfig = $INC{'PkgConfig.pm'}";

my $pkg = PkgConfig->find('nss');
is $pkg->errmsg, undef, 'no error';

is $pkg->get_var('prefix'), "/usr/local/opt/nss", "Correct prefix for nss";
is join(' ', $pkg->get_cflags), '-I/usr/local/opt/nss/include/nss -I/usr/local/Cellar/nspr/4.10.6/include/nspr', 'Cflags for nss correct';
is join(' ', $pkg->get_ldflags), '-L/usr/local/opt/nss/lib -lnss3 -lnssutil3 -lsmime3 -lssl3 -L/usr/local/Cellar/nspr/4.10.6/lib -lplds4 -lplc4 -lnspr4', 'Libs for nss correct';

$pkg = PkgConfig->find('foo');
like $pkg->errmsg, qr{Can't find bogus\.pc in any of}, 'not found error';
note $pkg->errmsg;

done_testing;