summaryrefslogtreecommitdiff
path: root/RunGrepTest.in
diff options
context:
space:
mode:
authornigel <nigel@2f5784b3-3f2a-0410-8824-cb99058d5e15>2007-02-24 21:40:45 +0000
committernigel <nigel@2f5784b3-3f2a-0410-8824-cb99058d5e15>2007-02-24 21:40:45 +0000
commit97cb05691b9cabed35f1a853c74d48c692aaabcf (patch)
treecb7c68a44f0b79c6d90d9a18a7ec640c8435a5e7 /RunGrepTest.in
parent455fcc7e13a175722acfd2cca6ab99caa9606a22 (diff)
downloadpcre-97cb05691b9cabed35f1a853c74d48c692aaabcf.tar.gz
Load pcre-6.0 into code/trunk.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@77 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'RunGrepTest.in')
-rw-r--r--RunGrepTest.in137
1 files changed, 137 insertions, 0 deletions
diff --git a/RunGrepTest.in b/RunGrepTest.in
new file mode 100644
index 0000000..57ac403
--- /dev/null
+++ b/RunGrepTest.in
@@ -0,0 +1,137 @@
+#! /bin/sh
+
+# This file is generated by configure from RunGrepTest.in. Make any changes
+# to that file.
+
+echo "Testing pcregrep"
+
+# Run pcregrep tests. The assumption is that the PCRE tests check the library
+# itself. What we are checking here is the file handling and options that are
+# supported by pcregrep.
+
+cf=diff
+testdata=@top_srcdir@/testdata
+
+./pcregrep -V 2>testtry
+
+echo "---------------------------- Test 1 ------------------------------" >>testtry
+./pcregrep PATTERN $testdata/grepinput >>testtry
+
+echo "---------------------------- Test 2 ------------------------------" >>testtry
+./pcregrep '^PATTERN' $testdata/grepinput >>testtry
+
+echo "---------------------------- Test 3 ------------------------------" >>testtry
+./pcregrep -in PATTERN $testdata/grepinput >>testtry
+
+echo "---------------------------- Test 4 ------------------------------" >>testtry
+./pcregrep -ic PATTERN $testdata/grepinput >>testtry
+
+echo "---------------------------- Test 5 ------------------------------" >>testtry
+./pcregrep -in PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 6 ------------------------------" >>testtry
+./pcregrep -inh PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 7 ------------------------------" >>testtry
+./pcregrep -il PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 8 ------------------------------" >>testtry
+./pcregrep -l PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 9 ------------------------------" >>testtry
+./pcregrep -q PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
+echo "RC=$?" >>testtry
+
+echo "---------------------------- Test 10 -----------------------------" >>testtry
+./pcregrep -q NEVER-PATTERN $testdata/grepinput $testdata/grepinputx >>testtry
+echo "RC=$?" >>testtry
+
+echo "---------------------------- Test 11 -----------------------------" >>testtry
+./pcregrep -vn pattern $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 12 -----------------------------" >>testtry
+./pcregrep -ix pattern $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 13 -----------------------------" >>testtry
+./pcregrep -f$testdata/greplist $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 14 -----------------------------" >>testtry
+./pcregrep -w pat $testdata/grepinput $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 15 -----------------------------" >>testtry
+./pcregrep 'abc^*' $testdata/grepinput 2>>testtry >>testtry
+
+echo "---------------------------- Test 16 -----------------------------" >>testtry
+./pcregrep abc $testdata/grepinput $testdata/nonexistfile 2>>testtry >>testtry
+
+echo "---------------------------- Test 17 -----------------------------" >>testtry
+./pcregrep -M 'the\noutput' $testdata/grepinput >>testtry
+
+echo "---------------------------- Test 18 -----------------------------" >>testtry
+./pcregrep -Mn '(the\noutput|dog\.\n--)' $testdata/grepinput >>testtry
+
+echo "---------------------------- Test 19 -----------------------------" >>testtry
+./pcregrep -Mix 'Pattern' $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 20 -----------------------------" >>testtry
+./pcregrep -Mixn 'complete pair\nof lines' $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 21 -----------------------------" >>testtry
+./pcregrep -nA3 'four' $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 22 -----------------------------" >>testtry
+./pcregrep -nB3 'four' $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 23 -----------------------------" >>testtry
+./pcregrep -C3 'four' $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 24 -----------------------------" >>testtry
+./pcregrep -A9 'four' $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 25 -----------------------------" >>testtry
+./pcregrep -nB9 'four' $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 26 -----------------------------" >>testtry
+./pcregrep -A9 -B9 'four' $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 27 -----------------------------" >>testtry
+./pcregrep -A10 'four' $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 28 -----------------------------" >>testtry
+./pcregrep -nB10 'four' $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 29 -----------------------------" >>testtry
+./pcregrep -C12 -B10 'four' $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 30 -----------------------------" >>testtry
+./pcregrep -inB3 'pattern' $testdata/grepinput $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 31 -----------------------------" >>testtry
+./pcregrep -inA3 'pattern' $testdata/grepinput $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 32 -----------------------------" >>testtry
+./pcregrep -L 'fox' $testdata/grepinput $testdata/grepinputx >>testtry
+
+echo "---------------------------- Test 33 -----------------------------" >>testtry
+./pcregrep 'fox' $testdata/grepnonexist >>testtry 2>&1
+echo "RC=$?" >>testtry
+
+echo "---------------------------- Test 34 -----------------------------" >>testtry
+./pcregrep -s 'fox' $testdata/grepnonexist >>testtry 2>&1
+echo "RC=$?" >>testtry
+
+echo "---------------------------- Test 35 -----------------------------" >>testtry
+./pcregrep -L -r --include=grepinputx 'fox' $testdata >>testtry
+echo "RC=$?" >>testtry
+
+echo "---------------------------- Test 36 -----------------------------" >>testtry
+./pcregrep -L -r --include=grepinput --exclude 'grepinput$' 'fox' $testdata >>testtry
+echo "RC=$?" >>testtry
+
+
+# Now compare the results.
+
+$cf testtry $testdata/grepoutput
+if [ $? != 0 ] ; then exit 1; else exit 0; fi
+
+# End