|
Last change
on this file since 2595 was 2595, checked in by bird, 12 years ago |
|
gnu grep version 2.12 (grep-2.12.tar.xz, md5sum=8d2f0346d08b13c18afb81f0e8aa1e2f)
|
|
File size:
852 bytes
|
| Line | |
|---|
| 1 | #!/bin/sh
|
|---|
| 2 | # Check that grep doesn't mishandle long matching lines.
|
|---|
| 3 |
|
|---|
| 4 | . "${srcdir=.}/init.sh"; path_prepend_ ../src
|
|---|
| 5 | expensive_
|
|---|
| 6 |
|
|---|
| 7 | # Create a one-line file containing slightly more than 2 GiB.
|
|---|
| 8 | echo x | dd bs=1024k seek=2048 >2G-plus-2 || framework_failure_
|
|---|
| 9 |
|
|---|
| 10 | skip_diagnostic=
|
|---|
| 11 |
|
|---|
| 12 | # These two patterns catch different kinds of
|
|---|
| 13 | # failures due to internal integer overflows.
|
|---|
| 14 | for pattern in '^.*' '^.*x\(\)\1'; do
|
|---|
| 15 | diagnostic=$(LC_ALL=C grep -a "$pattern" 2G-plus-2 2>&1 >/dev/null)
|
|---|
| 16 | status=$?
|
|---|
| 17 |
|
|---|
| 18 | case $status,$diagnostic in
|
|---|
| 19 | 0,*) ;;
|
|---|
| 20 | 2,*': line too long for re_search')
|
|---|
| 21 | skip_diagnostic='regular expression library cannot handle the test' ;;
|
|---|
| 22 | 2,*': memory exhausted')
|
|---|
| 23 | skip_diagnostic='not enough main memory to run the test' ;;
|
|---|
| 24 | *) fail=1 ;;
|
|---|
| 25 | esac
|
|---|
| 26 | done
|
|---|
| 27 |
|
|---|
| 28 | case $fail,$skip_diagnostic in
|
|---|
| 29 | 0,?*) skip_ "$skip_diagnostic" ;;
|
|---|
| 30 | esac
|
|---|
| 31 |
|
|---|
| 32 | Exit $fail
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.