Selon Jim Meyering <[email protected]>: .. > > Writing a perl script sounds like a better investment. > Hmm... maybe just do the timing in perl. > That gives this small patch: > > diff --git a/tests/backref-multibyte-slow b/tests/backref-multibyte-slow > index eb32b43..940d6df 100644 > --- a/tests/backref-multibyte-slow > +++ b/tests/backref-multibyte-slow > @@ -10,9 +10,16 @@ fail=0 > # Create a 13000-line input > $AWK 'BEGIN {for (i=0; i<13000; i++) print "aba"}' /dev/null > in || fail=1 > > +# Use 10 times the duration of running grep in the C locale as the timeout > +# when running in en_US.UTF-8. Round up to whole seconds, since timeout > +# can't deal with fractional seconds. > +max_seconds=$(LC_ALL=C perl -le 'use Time::HiRes qw(time); my $s = time(); > + system q,grep -E '\''^([a-z]).\1$'\'' in > /dev/null,; > + my $elapsed = time() - $s; print int (1 + 10 * $elapsed)') > + > for LOC in en_US.UTF-8; do > out=out-$LOC > - LC_ALL=$LOC timeout 5s grep -E '^([a-z]).\1$' in > $out 2>&1 > + LC_ALL=$LOC timeout ${max_seconds}s grep -E '^([a-z]).\1$' in > $out 2>&1 > test $? = 0 || fail=1 > compare $out in || fail=1 > done > > However, it's incomplete, since it doesn't first ensure that perl > is available. Also, the factor of 10 may not be enough on some systems. > > Gilles, does that work for you? > Will test tonight. At least perl is always available on LFS build style.
If perl is not available, probably test should be skipped. Gilles
