From 06c80a59fc8f550b6c69d04e2fc00578b4e80d59 Mon Sep 17 00:00:00 2001 From: Todd Rinaldo Date: Wed, 13 Sep 2017 14:35:39 -0500 Subject: ext/B/t/strict.t: Assure B.pm and O.pm pass strict and warnings checks. We need to test these in unit tests since they do not load these modules to prevent pollution of the stash in compilers. --- ext/B/t/strict.t | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 ext/B/t/strict.t (limited to 'ext/B') diff --git a/ext/B/t/strict.t b/ext/B/t/strict.t new file mode 100644 index 0000000000..4d1b84aa20 --- /dev/null +++ b/ext/B/t/strict.t @@ -0,0 +1,30 @@ +#!./perl -w + +use strict; +use warnings; + +use Config; +use Test::More; + +BEGIN { + if ( ( $Config{'extensions'} !~ /\sB\s/ ) ) { + plan skip_all => "Perl was not compiled with B"; + exit 0; + } +} + +use strict; +use warnings; + +use B (); +use O (); + +foreach my $module (qw/B O/) { + my $path = $INC{ $module . '.pm' }; + my $check = "$^X -cw -Mstrict $path 2>&1"; + my $got = `$check`; + is( $got, "$path syntax OK\n", "$module.pm compiles without errors" ) + or diag($got); +} + +done_testing(); -- cgit v1.2.1