Alt-ExtUtils-PkgConfig-PLICEASE

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

cpanfile
dist.ini
lib/Alt/ExtUtils/PkgConfig/PLICEASE.pm
lib/ExtUtils/PkgConfig.pm
t/00_diag.t
t/01_use.t
t/1.t
t/2.t
t/3.t
t/4.t
t/swallow_stderr.inc
t/test_glib-2.0.pc
t/test_non_numeric.pc
t/test_short.pc
xt/author/eol.t
xt/author/no_tabs.t
xt/author/pod.t
xt/author/pod_coverage.t
xt/author/pod_spelling_system.t
xt/author/strict.t
xt/author/version.t

t/1.t  view on Meta::CPAN

#

use strict;
use warnings;

#########################

use Test::More tests => 7;
BEGIN { use_ok('ExtUtils::PkgConfig') };

require 't/swallow_stderr.inc';

#########################

require PkgConfig::LibPkgConf;
diag ("Testing against PkgConfig::LibPkgConf $PkgConfig::LibPkgConf::VERSION");

$ENV{PKG_CONFIG_PATH} = './t/';

my %pkg;

# test 1 for success
eval { %pkg = ExtUtils::PkgConfig->find(qw/test_glib-2.0/); };
ok( not $@ );
ok( $pkg{modversion} and $pkg{cflags} and $pkg{libs} );

# test 1 for failure
swallow_stderr (sub {
  eval { %pkg = ExtUtils::PkgConfig->find(qw/bad1/); };
  ok( $@ );
});

# test 2 for success
eval { %pkg = ExtUtils::PkgConfig->find(qw/bad1 test_glib-2.0/); };
ok( not $@ );
ok( $pkg{modversion} and $pkg{cflags} and $pkg{libs} );

# test 2 for failure
swallow_stderr (sub {
  eval { %pkg = ExtUtils::PkgConfig->find(qw/bad1 bad2/); };
  ok( $@ );
});

t/4.t  view on Meta::CPAN

#
# $Id$
#

use strict;
use warnings;

use Test::More tests => 24;
use ExtUtils::PkgConfig;

require 't/swallow_stderr.inc';

$ENV{PKG_CONFIG_PATH} = './t/';

sub contains {
  my ($string, $sub_string) = @_;
  return -1 != index ($string, $sub_string);
}

my $macros;

t/4.t  view on Meta::CPAN

ok (contains ($macros, 'TEST_MICRO_VERSION (4)'));
ok (contains ($macros, 'TEST_CHECK_VERSION'));

# Check that '2' is turned into 2.0.0
$macros = ExtUtils::PkgConfig->create_version_macros (qw/test_short/, 'TEST');
ok (contains ($macros, 'TEST_MAJOR_VERSION (2)'));
ok (contains ($macros, 'TEST_MINOR_VERSION (0)'));
ok (contains ($macros, 'TEST_MICRO_VERSION (0)'));
ok (contains ($macros, 'TEST_CHECK_VERSION'));

swallow_stderr (sub {
  eval {
    ExtUtils::PkgConfig->create_version_macros (qw/__bad__/, 'BAD');
  };
  ok ($@);
});

my $header = 'eupc_test_tmp.h';

ExtUtils::PkgConfig->write_version_macros (
  $header,

t/4.t  view on Meta::CPAN

ok (contains ($macros, 'GLIB_MINOR_VERSION'));
ok (contains ($macros, 'GLIB_MICRO_VERSION'));
ok (contains ($macros, 'GLIB_CHECK_VERSION'));
ok (contains ($macros, 'TEST_MAJOR_VERSION'));
ok (contains ($macros, 'TEST_MINOR_VERSION'));
ok (contains ($macros, 'TEST_MICRO_VERSION'));
ok (contains ($macros, 'TEST_CHECK_VERSION'));
close $fh;
unlink $header;

swallow_stderr (sub {
  eval {
    ExtUtils::PkgConfig->write_version_macros (
    $header,
    '__bad__' => 'BAD');
  };
  ok ($@);
});

if (-f $header) {
  unlink $header;

t/swallow_stderr.inc  view on Meta::CPAN

sub swallow_stderr {
	my ($code) = @_;

	# We can't use the three-arg form with >& because perl 5.6 doesn't seem
	# to support that.
	open my $old_stderr, '>&STDERR';
	close STDERR;

	$code->();

	open STDERR, ">&$old_stderr";
}

1;

xt/author/pod_spelling_system.t  view on Meta::CPAN

  if -r $config_filename;

plan skip_all => 'disabled' if $config->{pod_spelling_system}->{skip};

chdir(File::Spec->catdir($FindBin::Bin, File::Spec->updir, File::Spec->updir));

add_stopwords(@{ $config->{pod_spelling_system}->{stopwords} });
add_stopwords(qw(
Plicease
stdout
stderr
stdin
subref
loopback
username
os
Ollis
Mojolicious
plicease
CPAN
reinstall



( run in 0.555 second using v1.01-cache-2.11-cpan-49f99fa48dc )