diff options
Diffstat (limited to 't/porting/exec-bit.t')
-rw-r--r-- | t/porting/exec-bit.t | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/t/porting/exec-bit.t b/t/porting/exec-bit.t new file mode 100644 index 0000000000..7971ed7c27 --- /dev/null +++ b/t/porting/exec-bit.t @@ -0,0 +1,43 @@ +#!/perl -w +use 5.010; +use strict; + +# This test checks that anything with an executable bit is +# identified in Porting/exec-bit.txt to makerel will set +# the exe bit in the release tarball + +require './test.pl'; + +plan('no_plan'); + +use ExtUtils::Manifest qw(maniread); +use File::Basename; +use File::Find; +use File::Spec::Functions; + +# Copied from Porting/makerel - these will get +x in the tarball +# XXX refactor? -- dagolden, 2010-07-23 +my %exe_list = + map { $_ => 1 } + map { my ($f) = split; glob($f) } + grep { $_ !~ /\A#/ && $_ !~ /\A\s*\z/ } + map { split "\n" } + do { local (@ARGV, $/) = '../Porting/exec-bit.txt'; <> }; + +# Get MANIFEST +$ExtUtils::Manifest::Quiet = 1; +my @manifest = sort keys %{ maniread("../MANIFEST") }; + +# Check that +x files in repo get +x from makerel +for my $f ( @manifest ) { + next unless -x "../$f"; + + ok( $exe_list{$f}, "tarball will chmod +x $f" ) + or diag( "Remove the exec bit or add to Porting/exec-bit.txt" ); + + delete $exe_list{$f}; # seen it +} + +ok( ! %exe_list, "Everything in Porting/exec-bit.txt has +x in repo" ) + or diag( "Files missing exec bit:\n " . join("\n ", sort keys %exe_list) . "\n"); + |