1#!/usr/bin/perl -w
2use strict;
3use warnings;
4use File::Spec;
5use Test::More tests =>  1;
6use lib (-d 't' ? File::Spec->catdir(qw(t lib)) : 'lib');
7use ExtUtils::ParseXS qw(process_file);
8
9chdir('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}
22