summaryrefslogtreecommitdiff
path: root/RunGrepTest
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2007-05-02 10:58:35 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2007-05-02 10:58:35 +0000
commitf928fc290573ad8fdc4e3ae8decd0a18f3cff828 (patch)
tree613844365cad5e4d4b969ac86b68533c0cf503e8 /RunGrepTest
parent4b9dcf13062cca86e30b199b45e2d98256b103a3 (diff)
downloadpcre-f928fc290573ad8fdc4e3ae8decd0a18f3cff828.tar.gz
Fix RunGrepTest for make distcheck (previous change added a bug).
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@160 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'RunGrepTest')
-rwxr-xr-xRunGrepTest21
1 files changed, 11 insertions, 10 deletions
diff --git a/RunGrepTest b/RunGrepTest
index 7fe5295..0e3bdc2 100755
--- a/RunGrepTest
+++ b/RunGrepTest
@@ -229,32 +229,33 @@ fi
# We go to some contortions to try to ensure that the tests for the various
# newline settings will work in environments where the normal newline sequence
-# is not \n. Note the messy fudge to get printf to write a string that starts
-# with a hyphen.
+# is not \n. Do not use exported files, whose line endings might be changed.
+# Instead, create an input file using printf so that its contents are exactly
+# what we want. Note the messy fudge to get printf to write a string that
+# starts with a hyphen.
echo "Testing pcregrep newline settings"
-
-printf "abc\rdef\r\nghi\njkl" >$srcdir/testNinput
+printf "abc\rdef\r\nghi\njkl" >testNinput
printf "%c--------------------------- Test N1 ------------------------------\r\n" - >testtry
-(cd $srcdir; $valgrind $pcregrep -n -N CR "^(abc|def|ghi|jkl)" testNinput) >>testtry
+$valgrind $pcregrep -n -N CR "^(abc|def|ghi|jkl)" testNinput >>testtry
printf "%c--------------------------- Test N2 ------------------------------\r\n" - >>testtry
-(cd $srcdir; $valgrind $pcregrep -n --newline=crlf "^(abc|def|ghi|jkl)" testNinput) >>testtry
+$valgrind $pcregrep -n --newline=crlf "^(abc|def|ghi|jkl)" testNinput >>testtry
printf "%c--------------------------- Test N3 ------------------------------\r\n" - >>testtry
pattern=`printf 'def\rjkl'`
-(cd $srcdir; $valgrind $pcregrep -n --newline=cr -F "$pattern" testNinput) >>testtry
+$valgrind $pcregrep -n --newline=cr -F "$pattern" testNinput >>testtry
printf "%c--------------------------- Test N4 ------------------------------\r\n" - >>testtry
pattern=`printf 'xxx\r\njkl'`
-(cd $srcdir; $valgrind $pcregrep -n --newline=crlf -F "$pattern" testNinput) >>testtry
+$valgrind $pcregrep -n --newline=crlf -F "$pattern" testNinput >>testtry
printf "%c--------------------------- Test N5 ------------------------------\r\n" - >>testtry
-(cd $srcdir; $valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" testNinput) >>testtry
+$valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" testNinput >>testtry
printf "%c--------------------------- Test N6 ------------------------------\r\n" - >>testtry
-(cd $srcdir; $valgrind $pcregrep -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinput) >>testtry
+$valgrind $pcregrep -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinput >>testtry
$cf $srcdir/testdata/grepoutputN testtry
if [ $? != 0 ] ; then exit 1; fi