mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-08-07 07:22:55 +03:00
tests: refactor to use the new getlimits utility
* tests/Coreutils.pm: Add function to make limits available * tests/test-lib.sh: ditto * tests/misc/join: Check for both SIZE_OFLOW and UINTMAX_OFLOW rather than using arbitrary 2^128 * tests/misc/sort: ditto * tests/misc/uniq: ditto * tests/misc/printf: Check for both INT_OFLOW and INT_UFLOW rather than using arbitrary -2^31 * tests/misc/seq-long-double: Check for INTMAX_OFLOW rather than using arbitrary 2^63 * tests/misc/split-fail: Check --lines --bytes and --line-bytes options limits on all platforms. Note getlimits obviates the need to use expr to check if 32 bit integers are supported, which I think was invalid anyway as expr now supports bignum? * tests/misc/test: Check for UINTMAX_OFLOW rather than using arbitrary 2^64 and 2^128. Check for INTMAX_UFLOW rather than using arbitrary -2^64 * tests/misc/timeout-parameters: Check for UINT_OFLOW rather than using arbitrary 2^32 * tests/misc/truncate-overflow: Don't depend on truncate to determine if we're on a 32 or 64 bit platform and instead use the various OFF_T limits * tests/misc/sort-merge: Check for UINTMAX_OFLOW rather than using arbitrary 2^64+1 * tests/misc/unexpand: ditto
This commit is contained in:
@@ -24,7 +24,7 @@ use File::Compare qw(compare);
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
($VERSION = '$Revision: 1.5 $ ') =~ tr/[0-9].//cd;
|
||||
@EXPORT = qw (run_tests triple_test);
|
||||
@EXPORT = qw (run_tests triple_test getlimits);
|
||||
|
||||
my $debug = $ENV{DEBUG};
|
||||
|
||||
@@ -204,6 +204,14 @@ sub _at_replace ($$)
|
||||
return $s;
|
||||
}
|
||||
|
||||
sub getlimits()
|
||||
{
|
||||
my $NV;
|
||||
open $NV, "getlimits |" or die "Error running getlimits\n";
|
||||
my %limits = map {split /=|\n/} <$NV>;
|
||||
return \%limits;
|
||||
}
|
||||
|
||||
# FIXME: cleanup on interrupt
|
||||
# FIXME: extract `do_1_test' function
|
||||
|
||||
|
Reference in New Issue
Block a user