Skip to content

Commit

Permalink
Add a way to skip utils/ files that need 64 bit ints
Browse files Browse the repository at this point in the history
 # Failed test 83 - utils/zipdetails compiles at porting/utils.t line 85
 #      got "Integer overflow in hexadecimal number at utils/zipdetails line 1432.
 Integer overflow in hexadecimal number at utils/zipdetails line 2247.
 Integer overflow in hexadecimal number at utils/zipdetails line 2248.
 Integer overflow in hexadecimal number at utils/zipdetails line 2249.
 Integer overflow in hexadecimal number at utils/zipdetails line 2250.
 Integer overflow in hexadecimal number at utils/zipdetails line 2251.
 Integer overflow in hexadecimal number at utils/zipdetails line 2252.
 Integer overflow in hexadecimal number at utils/zipdetails line 2253.
 Integer overflow in hexadecimal number at utils/zipdetails line 2254.
 utils/zipdetails syntax OK
 "
 # expected "utils/zipdetails syntax OK
 "
 t/porting/utils .................................................. FAILED at test 83

This patch adds a way that utils of this form can exit early with a
warning containing the magic phrase "requires 64 bit integers", in
which case the compile test will be skipped.

I will push a corresponding patch to https://github.com/pmqs/zipdetails
which is the upstream repository for cpan/IO-Compress/bin/zipdetails
which is hosted at https://github.com/pmqs/IO-Compress

This problem seems to have started when IO-Compress 2.105 was merged
in 131aabd.
  • Loading branch information
demerphq committed Apr 12, 2022
1 parent 83c93d5 commit 9821921
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions t/porting/utils.t
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,21 @@ foreach (@maybe) {

printf "1..%d\n", scalar @victims;

# Does this perl have 64 bit integers?
my $has_64bit_ints= eval { pack "Q", 1 };

foreach my $victim (@victims) {
SKIP: {
skip ("$victim uses $excuses{$victim}, so can't test with just core modules")
if $excuses{$victim};

my $got = runperl(switches => ['-c'], progfile => $victim, stderr => 1, nolib => 1);

# check to see if this script needs 64 bit integers.
if (!$has_64bit_ints and $got=~/requires 64 bit integers/) {
skip("$victim requires 64 bit integers and this is a 32 bit Perl", 1);
}

is($got, "$victim syntax OK\n", "$victim compiles")
or diag("when executing perl with '-c $victim'");
}
Expand Down

0 comments on commit 9821921

Please sign in to comment.