ere.awk revision 55360
153568SobrienBEGIN {
253568Sobrien	FS="@";
353568Sobrien	n = 0;
453568Sobrien	printf ("# Generated Spencer ERE Test\n");
553568Sobrien	printf ("failures=0\n");
653568Sobrien}
753568Sobrien
853568Sobrien$0 ~ /^#/  { next; }
953568Sobrien
1053568SobrienNF == 3 {
1155360Sobrien	printf ("status=`echo '%s' | { ${GREP} -E -e '%s' > /dev/null 2>&1; echo $?; cat >/dev/null; }`\n",$3, $2);
1255360Sobrien	printf ("if test $status -ne %s ; then\n", $1);
1353568Sobrien	printf ("\techo Spencer ere test \\#%d failed\n", ++n);
1453568Sobrien	printf ("\tfailures=1\n");
1553568Sobrien	printf ("fi\n");
1653568Sobrien}
1753568Sobrien
1853568SobrienNF == 4 {
1953568Sobrien# don't alarm the user for now
2053568Sobrien#	printf ("echo '%s'|${GREP} -E -e '%s' > /dev/null 2>&1\n",$3, $2);
2153568Sobrien#	printf ("if test $? -ne %s ; then\n", $1);
2253568Sobrien#	printf ("\techo Expected non conformance \\#%d ... continuing\n", ++n);
2353568Sobrien#	printf ("fi\n");
2453568Sobrien}
2553568Sobrien
2653568SobrienNF == 5 {
2753568Sobrien# don't alarm the user for now
2853568Sobrien	next;
2953568Sobrien}
3053568Sobrien
3153568SobrienEND { printf ("exit $failures\n"); }
32