| 1 |
#!/usr/bin/perl |
| 2 |
use strict; |
| 3 |
use warnings; |
| 4 |
$| = 1; |
| 5 |
use Test::More tests => 4; |
| 6 |
use File::Spec; |
| 7 |
use lib (-d 't' ? File::Spec->catdir(qw(t lib)) : 'lib'); |
| 8 |
use ExtUtils::ParseXS::Utilities qw( |
| 9 |
standard_XS_defs |
| 10 |
); |
| 11 |
use PrimitiveCapture; |
| 12 |
|
| 13 |
my @statements = ( |
| 14 |
'#ifndef PERL_UNUSED_VAR', |
| 15 |
'#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE', |
| 16 |
'#ifdef newXS_flags', |
| 17 |
); |
| 18 |
|
| 19 |
my $stdout = PrimitiveCapture::capture_stdout(sub { |
| 20 |
standard_XS_defs(); |
| 21 |
}); |
| 22 |
|
| 23 |
foreach my $s (@statements) { |
| 24 |
like( $stdout, qr/$s/s, "Printed <$s>" ); |
| 25 |
} |
| 26 |
|
| 27 |
pass("Passed all tests in $0"); |