/[pcre]/code/trunk/RunGrepTest
ViewVC logotype

Contents of /code/trunk/RunGrepTest

Parent Directory Parent Directory | Revision Log Revision Log


Revision 585 - (hide annotations) (download)
Wed Jan 12 17:21:11 2011 UTC (3 years, 11 months ago) by ph10
File size: 17779 byte(s)
Fix pcregrep bug when --colour was used with -v.

1 nigel 77 #! /bin/sh
2    
3 ph10 138 # Run pcregrep tests. The assumption is that the PCRE tests check the library
4     # itself. What we are checking here is the file handling and options that are
5     # supported by pcregrep.
6 nigel 77
7 ph10 97 # Set the C locale, so that sort(1) behaves predictably.
8     LC_ALL=C
9     export LC_ALL
10    
11 ph10 138 pcregrep=`pwd`/pcregrep
12    
13 nigel 87 valgrind=
14     while [ $# -gt 0 ] ; do
15     case $1 in
16 ph10 97 valgrind) valgrind="valgrind -q --leak-check=no";;
17 ph10 585 *) echo "RunGrepTest: Unknown argument $1"; exit 1;;
18 nigel 87 esac
19     shift
20     done
21 nigel 77
22 ph10 585 echo " "
23     if [ "$valgrind" = "" ] ; then
24     echo "Testing pcregrep"
25     else
26     echo "Testing pcregrep using valgrind"
27     fi
28    
29     $pcregrep -V
30    
31 ph10 437 cf="diff -ub"
32    
33     # Set up a suitable "diff" command for comparison. Some systems have a diff
34     # that lacks a -u option. Try to deal with this; better do the test for the -b
35     # option as well.
36    
37 ph10 461 if diff -u /dev/null /dev/null; then
38 ph10 437 if diff -ub /dev/null /dev/null; then cf="diff -ub"; else cf="diff -u"; fi
39 ph10 461 else
40 ph10 437 if diff -b /dev/null /dev/null; then cf="diff -b"; else cf="diff"; fi
41     fi
42    
43 ph10 138 # If PCRE has been built in a directory other than the source directory, and
44     # this test is being run from "make check" as usual, then $(srcdir) will be
45     # set. If not, set it to the current directory. We then arrange to run the
46     # pcregrep command in the source directory so that the file names that appear
47     # in the output are always the same.
48    
49     if [ -z "$srcdir" -o ! -d "$srcdir/testdata" ] ; then
50     srcdir=.
51 ph10 142 fi
52 ph10 138
53 ph10 116 # Check for the availability of UTF-8 support
54    
55 nigel 93 ./pcretest -C | ./pcregrep "No UTF-8 support" >/dev/null
56 ph10 116 utf8=$?
57 nigel 93
58 nigel 87 echo "---------------------------- Test 1 ------------------------------" >testtry
59 ph10 138 (cd $srcdir; $valgrind $pcregrep PATTERN ./testdata/grepinput) >>testtry
60 ph10 564 echo "RC=$?" >>testtry
61 nigel 77
62     echo "---------------------------- Test 2 ------------------------------" >>testtry
63 ph10 138 (cd $srcdir; $valgrind $pcregrep '^PATTERN' ./testdata/grepinput) >>testtry
64 ph10 564 echo "RC=$?" >>testtry
65 nigel 77
66     echo "---------------------------- Test 3 ------------------------------" >>testtry
67 ph10 138 (cd $srcdir; $valgrind $pcregrep -in PATTERN ./testdata/grepinput) >>testtry
68 ph10 564 echo "RC=$?" >>testtry
69 nigel 77
70     echo "---------------------------- Test 4 ------------------------------" >>testtry
71 ph10 138 (cd $srcdir; $valgrind $pcregrep -ic PATTERN ./testdata/grepinput) >>testtry
72 ph10 564 echo "RC=$?" >>testtry
73 nigel 77
74     echo "---------------------------- Test 5 ------------------------------" >>testtry
75 ph10 138 (cd $srcdir; $valgrind $pcregrep -in PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtry
76 ph10 564 echo "RC=$?" >>testtry
77 nigel 77
78     echo "---------------------------- Test 6 ------------------------------" >>testtry
79 ph10 138 (cd $srcdir; $valgrind $pcregrep -inh PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtry
80 ph10 564 echo "RC=$?" >>testtry
81 nigel 77
82     echo "---------------------------- Test 7 ------------------------------" >>testtry
83 ph10 138 (cd $srcdir; $valgrind $pcregrep -il PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtry
84 ph10 564 echo "RC=$?" >>testtry
85 nigel 77
86     echo "---------------------------- Test 8 ------------------------------" >>testtry
87 ph10 138 (cd $srcdir; $valgrind $pcregrep -l PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtry
88 ph10 564 echo "RC=$?" >>testtry
89 nigel 77
90     echo "---------------------------- Test 9 ------------------------------" >>testtry
91 ph10 138 (cd $srcdir; $valgrind $pcregrep -q PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtry
92 nigel 77 echo "RC=$?" >>testtry
93    
94     echo "---------------------------- Test 10 -----------------------------" >>testtry
95 ph10 138 (cd $srcdir; $valgrind $pcregrep -q NEVER-PATTERN ./testdata/grepinput ./testdata/grepinputx) >>testtry
96 nigel 77 echo "RC=$?" >>testtry
97    
98     echo "---------------------------- Test 11 -----------------------------" >>testtry
99 ph10 138 (cd $srcdir; $valgrind $pcregrep -vn pattern ./testdata/grepinputx) >>testtry
100 ph10 564 echo "RC=$?" >>testtry
101 nigel 77
102     echo "---------------------------- Test 12 -----------------------------" >>testtry
103 ph10 138 (cd $srcdir; $valgrind $pcregrep -ix pattern ./testdata/grepinputx) >>testtry
104 ph10 564 echo "RC=$?" >>testtry
105 nigel 77
106     echo "---------------------------- Test 13 -----------------------------" >>testtry
107 ph10 138 (cd $srcdir; $valgrind $pcregrep -f./testdata/greplist ./testdata/grepinputx) >>testtry
108 ph10 564 echo "RC=$?" >>testtry
109 nigel 77
110     echo "---------------------------- Test 14 -----------------------------" >>testtry
111 ph10 138 (cd $srcdir; $valgrind $pcregrep -w pat ./testdata/grepinput ./testdata/grepinputx) >>testtry
112 ph10 564 echo "RC=$?" >>testtry
113 nigel 77
114     echo "---------------------------- Test 15 -----------------------------" >>testtry
115 ph10 138 (cd $srcdir; $valgrind $pcregrep 'abc^*' ./testdata/grepinput) 2>>testtry >>testtry
116 ph10 564 echo "RC=$?" >>testtry
117 nigel 77
118     echo "---------------------------- Test 16 -----------------------------" >>testtry
119 ph10 138 (cd $srcdir; $valgrind $pcregrep abc ./testdata/grepinput ./testdata/nonexistfile) 2>>testtry >>testtry
120 ph10 564 echo "RC=$?" >>testtry
121 nigel 77
122     echo "---------------------------- Test 17 -----------------------------" >>testtry
123 ph10 138 (cd $srcdir; $valgrind $pcregrep -M 'the\noutput' ./testdata/grepinput) >>testtry
124 ph10 564 echo "RC=$?" >>testtry
125 nigel 77
126     echo "---------------------------- Test 18 -----------------------------" >>testtry
127 ph10 138 (cd $srcdir; $valgrind $pcregrep -Mn '(the\noutput|dog\.\n--)' ./testdata/grepinput) >>testtry
128 ph10 564 echo "RC=$?" >>testtry
129 nigel 77
130     echo "---------------------------- Test 19 -----------------------------" >>testtry
131 ph10 138 (cd $srcdir; $valgrind $pcregrep -Mix 'Pattern' ./testdata/grepinputx) >>testtry
132 ph10 564 echo "RC=$?" >>testtry
133 nigel 77
134     echo "---------------------------- Test 20 -----------------------------" >>testtry
135 ph10 138 (cd $srcdir; $valgrind $pcregrep -Mixn 'complete pair\nof lines' ./testdata/grepinputx) >>testtry
136 ph10 564 echo "RC=$?" >>testtry
137 nigel 77
138     echo "---------------------------- Test 21 -----------------------------" >>testtry
139 ph10 138 (cd $srcdir; $valgrind $pcregrep -nA3 'four' ./testdata/grepinputx) >>testtry
140 ph10 564 echo "RC=$?" >>testtry
141 nigel 77
142     echo "---------------------------- Test 22 -----------------------------" >>testtry
143 ph10 138 (cd $srcdir; $valgrind $pcregrep -nB3 'four' ./testdata/grepinputx) >>testtry
144 ph10 564 echo "RC=$?" >>testtry
145 nigel 77
146     echo "---------------------------- Test 23 -----------------------------" >>testtry
147 ph10 138 (cd $srcdir; $valgrind $pcregrep -C3 'four' ./testdata/grepinputx) >>testtry
148 ph10 564 echo "RC=$?" >>testtry
149 nigel 77
150     echo "---------------------------- Test 24 -----------------------------" >>testtry
151 ph10 138 (cd $srcdir; $valgrind $pcregrep -A9 'four' ./testdata/grepinputx) >>testtry
152 ph10 564 echo "RC=$?" >>testtry
153 nigel 77
154     echo "---------------------------- Test 25 -----------------------------" >>testtry
155 ph10 138 (cd $srcdir; $valgrind $pcregrep -nB9 'four' ./testdata/grepinputx) >>testtry
156 ph10 564 echo "RC=$?" >>testtry
157 nigel 77
158     echo "---------------------------- Test 26 -----------------------------" >>testtry
159 ph10 138 (cd $srcdir; $valgrind $pcregrep -A9 -B9 'four' ./testdata/grepinputx) >>testtry
160 ph10 564 echo "RC=$?" >>testtry
161 nigel 77
162     echo "---------------------------- Test 27 -----------------------------" >>testtry
163 ph10 138 (cd $srcdir; $valgrind $pcregrep -A10 'four' ./testdata/grepinputx) >>testtry
164 ph10 564 echo "RC=$?" >>testtry
165 nigel 77
166     echo "---------------------------- Test 28 -----------------------------" >>testtry
167 ph10 138 (cd $srcdir; $valgrind $pcregrep -nB10 'four' ./testdata/grepinputx) >>testtry
168 ph10 564 echo "RC=$?" >>testtry
169 nigel 77
170     echo "---------------------------- Test 29 -----------------------------" >>testtry
171 ph10 138 (cd $srcdir; $valgrind $pcregrep -C12 -B10 'four' ./testdata/grepinputx) >>testtry
172 ph10 564 echo "RC=$?" >>testtry
173 nigel 77
174     echo "---------------------------- Test 30 -----------------------------" >>testtry
175 ph10 138 (cd $srcdir; $valgrind $pcregrep -inB3 'pattern' ./testdata/grepinput ./testdata/grepinputx) >>testtry
176 ph10 564 echo "RC=$?" >>testtry
177 nigel 77
178     echo "---------------------------- Test 31 -----------------------------" >>testtry
179 ph10 138 (cd $srcdir; $valgrind $pcregrep -inA3 'pattern' ./testdata/grepinput ./testdata/grepinputx) >>testtry
180 ph10 564 echo "RC=$?" >>testtry
181 nigel 77
182     echo "---------------------------- Test 32 -----------------------------" >>testtry
183 ph10 138 (cd $srcdir; $valgrind $pcregrep -L 'fox' ./testdata/grepinput ./testdata/grepinputx) >>testtry
184 ph10 564 echo "RC=$?" >>testtry
185 nigel 77
186     echo "---------------------------- Test 33 -----------------------------" >>testtry
187 ph10 138 (cd $srcdir; $valgrind $pcregrep 'fox' ./testdata/grepnonexist) >>testtry 2>&1
188 nigel 77 echo "RC=$?" >>testtry
189    
190     echo "---------------------------- Test 34 -----------------------------" >>testtry
191 ph10 138 (cd $srcdir; $valgrind $pcregrep -s 'fox' ./testdata/grepnonexist) >>testtry 2>&1
192 nigel 77 echo "RC=$?" >>testtry
193    
194     echo "---------------------------- Test 35 -----------------------------" >>testtry
195 ph10 571 (cd $srcdir; $valgrind $pcregrep -L -r --include=grepinputx --exclude-dir='^\.' 'fox' ./testdata) >>testtry
196 nigel 77 echo "RC=$?" >>testtry
197    
198     echo "---------------------------- Test 36 -----------------------------" >>testtry
199 ph10 325 (cd $srcdir; $valgrind $pcregrep -L -r --include=grepinput --exclude 'grepinput$' --exclude_dir='^\.' 'fox' ./testdata | sort) >>testtry
200 nigel 77 echo "RC=$?" >>testtry
201    
202 nigel 87 echo "---------------------------- Test 37 -----------------------------" >>testtry
203 ph10 138 (cd $srcdir; $valgrind $pcregrep '^(a+)*\d' ./testdata/grepinput) >>testtry 2>teststderr
204 nigel 87 echo "RC=$?" >>testtry
205     echo "======== STDERR ========" >>testtry
206     cat teststderr >>testtry
207 nigel 77
208 nigel 87 echo "---------------------------- Test 38 ------------------------------" >>testtry
209 ph10 138 (cd $srcdir; $valgrind $pcregrep '>\x00<' ./testdata/grepinput) >>testtry
210 ph10 564 echo "RC=$?" >>testtry
211 nigel 87
212     echo "---------------------------- Test 39 ------------------------------" >>testtry
213 ph10 138 (cd $srcdir; $valgrind $pcregrep -A1 'before the binary zero' ./testdata/grepinput) >>testtry
214 ph10 564 echo "RC=$?" >>testtry
215 nigel 87
216     echo "---------------------------- Test 40 ------------------------------" >>testtry
217 ph10 138 (cd $srcdir; $valgrind $pcregrep -B1 'after the binary zero' ./testdata/grepinput) >>testtry
218 ph10 564 echo "RC=$?" >>testtry
219 nigel 87
220     echo "---------------------------- Test 41 ------------------------------" >>testtry
221 ph10 138 (cd $srcdir; $valgrind $pcregrep -B1 -o '\w+ the binary zero' ./testdata/grepinput) >>testtry
222 ph10 564 echo "RC=$?" >>testtry
223 nigel 87
224 ph10 564 echo "---------------------------- Test 42 ------------------------------" >>testtry
225 ph10 138 (cd $srcdir; $valgrind $pcregrep -B1 -onH '\w+ the binary zero' ./testdata/grepinput) >>testtry
226 ph10 564 echo "RC=$?" >>testtry
227 nigel 87
228 ph10 564 echo "---------------------------- Test 43 ------------------------------" >>testtry
229 ph10 138 (cd $srcdir; $valgrind $pcregrep -on 'before|zero|after' ./testdata/grepinput) >>testtry
230 ph10 564 echo "RC=$?" >>testtry
231 nigel 87
232 ph10 564 echo "---------------------------- Test 44 ------------------------------" >>testtry
233 ph10 422 (cd $srcdir; $valgrind $pcregrep -on -e before -ezero -e after ./testdata/grepinput) >>testtry
234 ph10 564 echo "RC=$?" >>testtry
235 nigel 87
236 ph10 564 echo "---------------------------- Test 45 ------------------------------" >>testtry
237 ph10 138 (cd $srcdir; $valgrind $pcregrep -on -f ./testdata/greplist -e binary ./testdata/grepinput) >>testtry
238 ph10 564 echo "RC=$?" >>testtry
239 nigel 87
240 ph10 564 echo "---------------------------- Test 46 ------------------------------" >>testtry
241 ph10 422 (cd $srcdir; $valgrind $pcregrep -eabc -e '(unclosed' ./testdata/grepinput) 2>>testtry >>testtry
242 ph10 564 echo "RC=$?" >>testtry
243 nigel 87
244 ph10 564 echo "---------------------------- Test 47 ------------------------------" >>testtry
245 ph10 138 (cd $srcdir; $valgrind $pcregrep -Fx "AB.VE
246     elephant" ./testdata/grepinput) >>testtry
247 ph10 564 echo "RC=$?" >>testtry
248 nigel 87
249 ph10 564 echo "---------------------------- Test 48 ------------------------------" >>testtry
250 ph10 138 (cd $srcdir; $valgrind $pcregrep -F "AB.VE
251     elephant" ./testdata/grepinput) >>testtry
252 ph10 564 echo "RC=$?" >>testtry
253 nigel 87
254 ph10 564 echo "---------------------------- Test 49 ------------------------------" >>testtry
255 ph10 138 (cd $srcdir; $valgrind $pcregrep -F -e DATA -e "AB.VE
256     elephant" ./testdata/grepinput) >>testtry
257 ph10 564 echo "RC=$?" >>testtry
258 nigel 87
259 ph10 564 echo "---------------------------- Test 50 ------------------------------" >>testtry
260 ph10 138 (cd $srcdir; $valgrind $pcregrep "^(abc|def|ghi|jkl)" ./testdata/grepinputx) >>testtry
261 ph10 564 echo "RC=$?" >>testtry
262 nigel 91
263 ph10 564 echo "---------------------------- Test 51 ------------------------------" >>testtry
264 ph10 222 (cd $srcdir; $valgrind $pcregrep -Mv "brown\sfox" ./testdata/grepinputv) >>testtry
265 ph10 564 echo "RC=$?" >>testtry
266 ph10 222
267 ph10 564 echo "---------------------------- Test 52 ------------------------------" >>testtry
268 ph10 239 (cd $srcdir; $valgrind $pcregrep --colour=always jumps ./testdata/grepinputv) >>testtry
269 ph10 564 echo "RC=$?" >>testtry
270 ph10 239
271 ph10 564 echo "---------------------------- Test 53 ------------------------------" >>testtry
272 ph10 280 (cd $srcdir; $valgrind $pcregrep --file-offsets 'before|zero|after' ./testdata/grepinput) >>testtry
273 ph10 564 echo "RC=$?" >>testtry
274 ph10 280
275 ph10 564 echo "---------------------------- Test 54 ------------------------------" >>testtry
276 ph10 280 (cd $srcdir; $valgrind $pcregrep --line-offsets 'before|zero|after' ./testdata/grepinput) >>testtry
277 ph10 564 echo "RC=$?" >>testtry
278 ph10 280
279 ph10 564 echo "---------------------------- Test 55 -----------------------------" >>testtry
280 ph10 378 (cd $srcdir; $valgrind $pcregrep -f./testdata/greplist --color=always ./testdata/grepinputx) >>testtry
281 ph10 564 echo "RC=$?" >>testtry
282 ph10 378
283 ph10 564 echo "---------------------------- Test 56 -----------------------------" >>testtry
284 ph10 420 (cd $srcdir; $valgrind $pcregrep -c lazy ./testdata/grepinput*) >>testtry
285 ph10 564 echo "RC=$?" >>testtry
286 ph10 420
287 ph10 564 echo "---------------------------- Test 57 -----------------------------" >>testtry
288 ph10 420 (cd $srcdir; $valgrind $pcregrep -c -l lazy ./testdata/grepinput*) >>testtry
289 ph10 564 echo "RC=$?" >>testtry
290 ph10 420
291 ph10 564 echo "---------------------------- Test 58 -----------------------------" >>testtry
292 ph10 422 (cd $srcdir; $valgrind $pcregrep --regex=PATTERN ./testdata/grepinput) >>testtry
293 ph10 564 echo "RC=$?" >>testtry
294 ph10 422
295 ph10 564 echo "---------------------------- Test 59 -----------------------------" >>testtry
296 ph10 422 (cd $srcdir; $valgrind $pcregrep --regexp=PATTERN ./testdata/grepinput) >>testtry
297 ph10 564 echo "RC=$?" >>testtry
298 ph10 422
299 ph10 564 echo "---------------------------- Test 60 -----------------------------" >>testtry
300 ph10 422 (cd $srcdir; $valgrind $pcregrep --regex PATTERN ./testdata/grepinput) >>testtry
301 ph10 564 echo "RC=$?" >>testtry
302 ph10 422
303 ph10 564 echo "---------------------------- Test 61 -----------------------------" >>testtry
304 ph10 422 (cd $srcdir; $valgrind $pcregrep --regexp PATTERN ./testdata/grepinput) >>testtry
305 ph10 564 echo "RC=$?" >>testtry
306 ph10 422
307 ph10 564 echo "---------------------------- Test 62 -----------------------------" >>testtry
308 ph10 561 (cd $srcdir; $valgrind $pcregrep --match-limit=1000 -M 'This is a file(.|\R)*file.' ./testdata/grepinput) >>testtry 2>&1
309 ph10 564 echo "RC=$?" >>testtry
310 ph10 561
311 ph10 564 echo "---------------------------- Test 63 -----------------------------" >>testtry
312 ph10 561 (cd $srcdir; $valgrind $pcregrep --recursion-limit=1000 -M 'This is a file(.|\R)*file.' ./testdata/grepinput) >>testtry 2>&1
313 ph10 564 echo "RC=$?" >>testtry
314 ph10 561
315 ph10 565 echo "---------------------------- Test 64 ------------------------------" >>testtry
316     (cd $srcdir; $valgrind $pcregrep -o1 '(?<=PAT)TERN (ap(pear)s)' ./testdata/grepinput) >>testtry
317     echo "RC=$?" >>testtry
318    
319     echo "---------------------------- Test 65 ------------------------------" >>testtry
320     (cd $srcdir; $valgrind $pcregrep -o2 '(?<=PAT)TERN (ap(pear)s)' ./testdata/grepinput) >>testtry
321     echo "RC=$?" >>testtry
322    
323     echo "---------------------------- Test 66 ------------------------------" >>testtry
324     (cd $srcdir; $valgrind $pcregrep -o3 '(?<=PAT)TERN (ap(pear)s)' ./testdata/grepinput) >>testtry
325     echo "RC=$?" >>testtry
326    
327     echo "---------------------------- Test 67 ------------------------------" >>testtry
328     (cd $srcdir; $valgrind $pcregrep -o12 '(?<=PAT)TERN (ap(pear)s)' ./testdata/grepinput) >>testtry
329     echo "RC=$?" >>testtry
330    
331     echo "---------------------------- Test 68 ------------------------------" >>testtry
332     (cd $srcdir; $valgrind $pcregrep --only-matching=2 '(?<=PAT)TERN (ap(pear)s)' ./testdata/grepinput) >>testtry
333     echo "RC=$?" >>testtry
334    
335 ph10 585 echo "---------------------------- Test 69 -----------------------------" >>testtry
336     (cd $srcdir; $valgrind $pcregrep -vn --colour=always pattern ./testdata/grepinputx) >>testtry
337     echo "RC=$?" >>testtry
338    
339 nigel 77 # Now compare the results.
340    
341 ph10 158 $cf $srcdir/testdata/grepoutput testtry
342 nigel 93 if [ $? != 0 ] ; then exit 1; fi
343 nigel 77
344 ph10 131
345 nigel 93 # These tests require UTF-8 support
346    
347 ph10 116 if [ $utf8 -ne 0 ] ; then
348 nigel 93 echo "Testing pcregrep UTF-8 features"
349 ph10 97
350 nigel 93 echo "---------------------------- Test U1 ------------------------------" >testtry
351 ph10 138 (cd $srcdir; $valgrind $pcregrep -n -u --newline=any "^X" ./testdata/grepinput8) >>testtry
352 ph10 564 echo "RC=$?" >>testtry
353 nigel 93
354     echo "---------------------------- Test U2 ------------------------------" >>testtry
355 ph10 138 (cd $srcdir; $valgrind $pcregrep -n -u -C 3 --newline=any "Match" ./testdata/grepinput8) >>testtry
356 ph10 564 echo "RC=$?" >>testtry
357 nigel 93
358 ph10 158 $cf $srcdir/testdata/grepoutput8 testtry
359 nigel 93 if [ $? != 0 ] ; then exit 1; fi
360    
361     else
362     echo "Skipping pcregrep UTF-8 tests: no UTF-8 support in PCRE library"
363     fi
364    
365 ph10 131
366 ph10 158 # We go to some contortions to try to ensure that the tests for the various
367 ph10 159 # newline settings will work in environments where the normal newline sequence
368 ph10 160 # is not \n. Do not use exported files, whose line endings might be changed.
369     # Instead, create an input file using printf so that its contents are exactly
370     # what we want. Note the messy fudge to get printf to write a string that
371     # starts with a hyphen.
372 ph10 131
373     echo "Testing pcregrep newline settings"
374 ph10 160 printf "abc\rdef\r\nghi\njkl" >testNinput
375 ph10 131
376 ph10 158 printf "%c--------------------------- Test N1 ------------------------------\r\n" - >testtry
377 ph10 160 $valgrind $pcregrep -n -N CR "^(abc|def|ghi|jkl)" testNinput >>testtry
378 ph10 131
379 ph10 158 printf "%c--------------------------- Test N2 ------------------------------\r\n" - >>testtry
380 ph10 160 $valgrind $pcregrep -n --newline=crlf "^(abc|def|ghi|jkl)" testNinput >>testtry
381 ph10 158
382     printf "%c--------------------------- Test N3 ------------------------------\r\n" - >>testtry
383 ph10 131 pattern=`printf 'def\rjkl'`
384 ph10 160 $valgrind $pcregrep -n --newline=cr -F "$pattern" testNinput >>testtry
385 ph10 131
386 ph10 158 printf "%c--------------------------- Test N4 ------------------------------\r\n" - >>testtry
387 ph10 131 pattern=`printf 'xxx\r\njkl'`
388 ph10 160 $valgrind $pcregrep -n --newline=crlf -F "$pattern" testNinput >>testtry
389 ph10 131
390 ph10 158 printf "%c--------------------------- Test N5 ------------------------------\r\n" - >>testtry
391 ph10 160 $valgrind $pcregrep -n --newline=any "^(abc|def|ghi|jkl)" testNinput >>testtry
392 ph10 131
393 ph10 158 printf "%c--------------------------- Test N6 ------------------------------\r\n" - >>testtry
394 ph10 160 $valgrind $pcregrep -n --newline=anycrlf "^(abc|def|ghi|jkl)" testNinput >>testtry
395 ph10 149
396 ph10 158 $cf $srcdir/testdata/grepoutputN testtry
397 ph10 131 if [ $? != 0 ] ; then exit 1; fi
398    
399 ph10 97 exit 0
400 nigel 93
401 nigel 77 # End

Properties

Name Value
svn:executable *
svn:keywords "Author Date Id Revision Url"

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12