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

Contents of /code/trunk/RunGrepTest.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 77 - (hide annotations) (download)
Sat Feb 24 21:40:45 2007 UTC (7 years, 7 months ago) by nigel
File size: 5971 byte(s)
Load pcre-6.0 into code/trunk.

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

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12