source: trunk/essentials/sys-apps/grep/tests/ere.awk

Last change on this file was 2557, checked in by bird, 19 years ago

grep 2.5.1a

File size: 828 bytes
Line 
1BEGIN {
2 FS="@";
3 n = 0;
4 printf ("# Generated Spencer ERE Test\n");
5 printf ("failures=0\n");
6}
7
8$0 ~ /^#/ { next; }
9
10NF == 3 {
11# printf ("status=`echo '%s' | { ${GREP} -E -e '%s' > /dev/null 2>&1; echo $?; cat >/dev/null; }`\n",$3, $2);
12 printf ("status=`echo '%s' | { ${GREP} -E -e '%s' > /dev/null 2>&1; echo $?; }`\n",$3, $2);
13 printf ("if test $status -ne %s ; then\n", $1);
14 printf ("\techo Spencer ere test \\#%d failed\n", ++n);
15 printf ("\tfailures=1\n");
16 printf ("fi\n");
17}
18
19NF == 4 {
20# don't alarm the user for now
21# printf ("echo '%s'|${GREP} -E -e '%s' > /dev/null 2>&1\n",$3, $2);
22# printf ("if test $? -ne %s ; then\n", $1);
23# printf ("\techo Expected non conformance \\#%d ... continuing\n", ++n);
24# printf ("fi\n");
25}
26
27NF == 5 {
28# don't alarm the user for now
29 next;
30}
31
32END { printf ("exit $failures\n"); }
Note: See TracBrowser for help on using the repository browser.