summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/grep/tests/ere.awk
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1999-11-22 09:32:57 +0000
committerobrien <obrien@FreeBSD.org>1999-11-22 09:32:57 +0000
commit18bbf176c89ad4e8bcded49759ff6f701c27ae3c (patch)
tree59edc7e5ea79e3ae16db7d18aad05ca222e21d23 /gnu/usr.bin/grep/tests/ere.awk
parentfac3cf264f5ad722ebdc3390aa6a6497b6b000e5 (diff)
downloadFreeBSD-src-18bbf176c89ad4e8bcded49759ff6f701c27ae3c.zip
FreeBSD-src-18bbf176c89ad4e8bcded49759ff6f701c27ae3c.tar.gz
Virgin import of GNU Grep 2.3 [trimmed down].
Diffstat (limited to 'gnu/usr.bin/grep/tests/ere.awk')
-rw-r--r--gnu/usr.bin/grep/tests/ere.awk31
1 files changed, 31 insertions, 0 deletions
diff --git a/gnu/usr.bin/grep/tests/ere.awk b/gnu/usr.bin/grep/tests/ere.awk
new file mode 100644
index 0000000..c014fe9
--- /dev/null
+++ b/gnu/usr.bin/grep/tests/ere.awk
@@ -0,0 +1,31 @@
+BEGIN {
+ FS="@";
+ n = 0;
+ printf ("# Generated Spencer ERE Test\n");
+ printf ("failures=0\n");
+}
+
+$0 ~ /^#/ { next; }
+
+NF == 3 {
+ printf ("echo '%s' | ${GREP} -E -e '%s' > /dev/null 2>&1\n",$3, $2);
+ printf ("if test $? -ne %s ; then\n", $1);
+ printf ("\techo Spencer ere test \\#%d failed\n", ++n);
+ printf ("\tfailures=1\n");
+ printf ("fi\n");
+}
+
+NF == 4 {
+# don't alarm the user for now
+# printf ("echo '%s'|${GREP} -E -e '%s' > /dev/null 2>&1\n",$3, $2);
+# printf ("if test $? -ne %s ; then\n", $1);
+# printf ("\techo Expected non conformance \\#%d ... continuing\n", ++n);
+# printf ("fi\n");
+}
+
+NF == 5 {
+# don't alarm the user for now
+ next;
+}
+
+END { printf ("exit $failures\n"); }
OpenPOWER on IntegriCloud