~ubuntu-branches/ubuntu/trusty/libyaml-tiny-perl/trusty-proposed

« back to all changes in this revision

Viewing changes to t/00-compile.t

  • Committer: Package Import Robot
  • Author(s): gregor herrmann
  • Date: 2013-10-05 16:34:12 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20131005163412-1zjgne628pa7n8k9
Tags: 1.56-1
* Team upload.
* New upstream release.
* Update build dependencies.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
use strict;
2
2
use warnings;
3
3
 
4
 
# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.030
 
4
# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.033
5
5
 
6
6
use Test::More 0.94 tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
7
7
 
15
15
 
16
16
# no fake home requested
17
17
 
 
18
use File::Spec;
18
19
use IPC::Open3;
19
20
use IO::Handle;
20
21
 
22
23
for my $lib (@module_files)
23
24
{
24
25
    # see L<perlfaq8/How can I capture STDERR from an external command?>
25
 
    my $stdin = '';     # converted to a gensym by open3
 
26
    open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
26
27
    my $stderr = IO::Handle->new;
27
28
 
28
 
    my $pid = open3($stdin, '>&STDERR', $stderr, qq{$^X -Mblib -e"require q[$lib]"});
29
 
    binmode $stderr, ':crlf' if $^O; # eq 'MSWin32';
 
29
    my $pid = open3($stdin, '>&STDERR', $stderr, $^X, '-Mblib', '-e', "require q[$lib]");
 
30
    binmode $stderr, ':crlf' if $^O eq 'MSWin32';
 
31
    my @_warnings = <$stderr>;
30
32
    waitpid($pid, 0);
31
33
    is($? >> 8, 0, "$lib loaded ok");
32
34
 
33
 
    if (my @_warnings = <$stderr>)
 
35
    if (@_warnings)
34
36
    {
35
37
        warn @_warnings;
36
38
        push @warnings, @_warnings;