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

Contents of /code/trunk/RunGrepTest.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 81 - (show annotations) (download)
Sat Feb 24 21:40:59 2007 UTC (7 years, 4 months ago) by nigel
File size: 6030 byte(s)
Load pcre-6.2 into code/trunk.

1 #! /bin/sh
2
3 # This file is generated by configure from RunGrepTest.in. Make any changes
4 # to that file.
5
6 echo "Testing pcregrep"
7
8 # Run pcregrep tests. The assumption is that the PCRE tests check the library
9 # itself. What we are checking here is the file handling and options that are
10 # supported by pcregrep.
11
12 cf=diff
13 if [ ! -d testdata ] ; then
14 ln -s @top_srcdir@/testdata testdata
15 fi
16 testdata=./testdata
17
18 ./pcregrep -V 2>testtry
19
20 echo "---------------------------- Test 1 ------------------------------" >>testtry
21 ./pcregrep PATTERN $testdata/grepinput >>testtry
22
23 echo "---------------------------- Test 2 ------------------------------" >>testtry
24 ./pcregrep '^PATTERN' $testdata/grepinput >>testtry
25
26 echo "---------------------------- Test 3 ------------------------------" >>testtry
27 ./pcregrep -in PATTERN $testdata/grepinput >>testtry
28
29 echo "---------------------------- Test 4 ------------------------------" >>testtry
30 ./pcregrep -ic PATTERN $testdata/grepinput >>testtry
31
32 echo "---------------------------- Test 5 ------------------------------" >>testtry
33 ./pcregrep -in PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
34
35 echo "---------------------------- Test 6 ------------------------------" >>testtry
36 ./pcregrep -inh PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
37
38 echo "---------------------------- Test 7 ------------------------------" >>testtry
39 ./pcregrep -il PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
40
41 echo "---------------------------- Test 8 ------------------------------" >>testtry
42 ./pcregrep -l PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
43
44 echo "---------------------------- Test 9 ------------------------------" >>testtry
45 ./pcregrep -q PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
46 echo "RC=$?" >>testtry
47
48 echo "---------------------------- Test 10 -----------------------------" >>testtry
49 ./pcregrep -q NEVER-PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
50 echo "RC=$?" >>testtry
51
52 echo "---------------------------- Test 11 -----------------------------" >>testtry
53 ./pcregrep -vn pattern $testdata/grepinputx >>testtry
54
55 echo "---------------------------- Test 12 -----------------------------" >>testtry
56 ./pcregrep -ix pattern $testdata/grepinputx >>testtry
57
58 echo "---------------------------- Test 13 -----------------------------" >>testtry
59 ./pcregrep -f$testdata/greplist $testdata/grepinputx >>testtry
60
61 echo "---------------------------- Test 14 -----------------------------" >>testtry
62 ./pcregrep -w pat $testdata/grepinput $testdata/grepinputx >>testtry
63
64 echo "---------------------------- Test 15 -----------------------------" >>testtry
65 ./pcregrep 'abc^*' $testdata/grepinput 2>>testtry >>testtry
66
67 echo "---------------------------- Test 16 -----------------------------" >>testtry
68 ./pcregrep abc $testdata/grepinput $testdata/nonexistfile 2>>testtry >>testtry
69
70 echo "---------------------------- Test 17 -----------------------------" >>testtry
71 ./pcregrep -M 'the\noutput' $testdata/grepinput >>testtry
72
73 echo "---------------------------- Test 18 -----------------------------" >>testtry
74 ./pcregrep -Mn '(the\noutput|dog\.\n--)' $testdata/grepinput >>testtry
75
76 echo "---------------------------- Test 19 -----------------------------" >>testtry
77 ./pcregrep -Mix 'Pattern' $testdata/grepinputx >>testtry
78
79 echo "---------------------------- Test 20 -----------------------------" >>testtry
80 ./pcregrep -Mixn 'complete pair\nof lines' $testdata/grepinputx >>testtry
81
82 echo "---------------------------- Test 21 -----------------------------" >>testtry
83 ./pcregrep -nA3 'four' $testdata/grepinputx >>testtry
84
85 echo "---------------------------- Test 22 -----------------------------" >>testtry
86 ./pcregrep -nB3 'four' $testdata/grepinputx >>testtry
87
88 echo "---------------------------- Test 23 -----------------------------" >>testtry
89 ./pcregrep -C3 'four' $testdata/grepinputx >>testtry
90
91 echo "---------------------------- Test 24 -----------------------------" >>testtry
92 ./pcregrep -A9 'four' $testdata/grepinputx >>testtry
93
94 echo "---------------------------- Test 25 -----------------------------" >>testtry
95 ./pcregrep -nB9 'four' $testdata/grepinputx >>testtry
96
97 echo "---------------------------- Test 26 -----------------------------" >>testtry
98 ./pcregrep -A9 -B9 'four' $testdata/grepinputx >>testtry
99
100 echo "---------------------------- Test 27 -----------------------------" >>testtry
101 ./pcregrep -A10 'four' $testdata/grepinputx >>testtry
102
103 echo "---------------------------- Test 28 -----------------------------" >>testtry
104 ./pcregrep -nB10 'four' $testdata/grepinputx >>testtry
105
106 echo "---------------------------- Test 29 -----------------------------" >>testtry
107 ./pcregrep -C12 -B10 'four' $testdata/grepinputx >>testtry
108
109 echo "---------------------------- Test 30 -----------------------------" >>testtry
110 ./pcregrep -inB3 'pattern' $testdata/grepinput $testdata/grepinputx >>testtry
111
112 echo "---------------------------- Test 31 -----------------------------" >>testtry
113 ./pcregrep -inA3 'pattern' $testdata/grepinput $testdata/grepinputx >>testtry
114
115 echo "---------------------------- Test 32 -----------------------------" >>testtry
116 ./pcregrep -L 'fox' $testdata/grepinput $testdata/grepinputx >>testtry
117
118 echo "---------------------------- Test 33 -----------------------------" >>testtry
119 ./pcregrep 'fox' $testdata/grepnonexist >>testtry 2>&1
120 echo "RC=$?" >>testtry
121
122 echo "---------------------------- Test 34 -----------------------------" >>testtry
123 ./pcregrep -s 'fox' $testdata/grepnonexist >>testtry 2>&1
124 echo "RC=$?" >>testtry
125
126 echo "---------------------------- Test 35 -----------------------------" >>testtry
127 ./pcregrep -L -r --include=grepinputx 'fox' $testdata >>testtry
128 echo "RC=$?" >>testtry
129
130 echo "---------------------------- Test 36 -----------------------------" >>testtry
131 ./pcregrep -L -r --include=grepinput --exclude 'grepinput$' 'fox' $testdata >>testtry
132 echo "RC=$?" >>testtry
133
134
135 # Now compare the results.
136
137 $cf testtry $testdata/grepoutput
138 if [ $? != 0 ] ; then exit 1; else exit 0; fi
139
140 # End

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12