Debian Codegraph @

dist/ExtUtils-ParseXS/t/115-avoid-noise.t

raw
1 #!/usr/bin/perl -w
2 use strict;
3 use warnings;
4 use File::Spec;
5 use Test::More tests => 1;
6 use lib (-d 't' ? File::Spec->catdir(qw(t lib)) : 'lib');
7 use ExtUtils::ParseXS qw(process_file);
8
9 chdir('t') if -d 't';
10
11 # Module-Build uses ExtUtils::ParseXS with $^W set, try to avoid
12 # warning in that case.
13
14 {
15 my $out;
16 open my $out_fh, ">", \$out;
17 my @warnings;
18 local $SIG{__WARN__} = sub { push @warnings, "@_" };
19 process_file(filename => "XSWarn.xs", output => $out_fh);
20 is_deeply(\@warnings, [], "shouldn't be any warnings");
21 }