xref: /openbsd-src/gnu/usr.bin/perl/dist/ExtUtils-ParseXS/t/115-avoid-noise.t (revision 50b7afb2c2c0993b0894d4e34bf857cb13ed9c80)
1#!/usr/bin/perl -w
2use strict;
3use warnings;
4use File::Spec;
5use Test::More tests =>  1;
6use lib qw( lib t/lib );
7use ExtUtils::ParseXS qw(process_file);
8
9chdir 't' or die "Can't chdir to 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}
22