Index: test/ChangeLog =================================================================== RCS file: /cvsroot/xmlgawk/xmlgawk/test/ChangeLog,v retrieving revision 1.2 diff -b -u -p -r1.2 ChangeLog --- test/ChangeLog 1 Jan 2006 22:46:23 -0000 1.2 +++ test/ChangeLog 3 Jul 2006 20:53:34 -0000 @@ -1,3 +1,13 @@ +Mon Jul 3 20:50:31 2006 Andrew J. Schorr + + * Makefile.am: In pid test, no further need to remove _pid.in, + since the test no longer creates that file. + * pid.awk: Do not read correct values from stdin (they are now passed + as command-line variables with -v). Make sure to produce output + if the comparisons are successful. + * pid.ok: No longer empty, should contain 3 lines if all goes well. + * pid.sh: Do not create _pid.in; instead, pass values in with -v. + Tue Jul 26 21:46:16 2005 Arnold D. Robbins * Release 3.1.5: Release tar file made. Index: test/Makefile.am =================================================================== RCS file: /cvsroot/xmlgawk/xmlgawk/test/Makefile.am,v retrieving revision 1.40 diff -b -u -p -r1.40 Makefile.am --- test/Makefile.am 22 Mar 2006 21:11:35 -0000 1.40 +++ test/Makefile.am 3 Jul 2006 20:53:34 -0000 @@ -902,7 +902,7 @@ tradanch:: pid:: @echo pid @AWKPATH=$(srcdir) AWK=$(AWKPROG) $(SHELL) $(srcdir)/pid.sh $$$$ > _`basename address@hidden ; : - @-$(CMP) $(srcdir)/pid.ok _`basename address@hidden && rm -f _`basename address@hidden _`basename address@hidden + @-$(CMP) $(srcdir)/pid.ok _`basename address@hidden && rm -f _`basename address@hidden strftlng:: @echo $@ Index: test/pid.awk =================================================================== RCS file: /cvsroot/xmlgawk/xmlgawk/test/pid.awk,v retrieving revision 1.1.1.1 diff -b -u -p -r1.1.1.1 pid.awk --- test/pid.awk 4 Jun 1997 16:38:16 -0000 1.1.1.1 +++ test/pid.awk 3 Jul 2006 20:53:34 -0000 @@ -27,18 +27,20 @@ BEGIN { getline pid <"/dev/pid" getline ppid <"/dev/ppid" -} -NR == 1 { - if (pid != $0) { - printf "Bad pid %d, wanted %d\n", $0, pid - } -} -NR == 2 { - if (ppid != $0) { - printf "Bad ppid %d, wanted %d\n", $0, ppid - } -} -END { # ADR --- added + + if (pid != ok_pid) + printf "Bad pid %d, wanted %d\n", pid, ok_pid + else + print "PID ok" + + if (ppid != ok_ppid) + printf "Bad ppid %d, wanted %d\n", ppid, ok_ppid + else + print "PPID ok" + + # ADR --- added close("/dev/pid") close("/dev/ppid") + + print "All Done." } Index: test/pid.ok =================================================================== RCS file: /cvsroot/xmlgawk/xmlgawk/test/pid.ok,v retrieving revision 1.1.1.1 diff -b -u -p -r1.1.1.1 pid.ok --- test/pid.ok 4 Jun 1997 16:38:33 -0000 1.1.1.1 +++ test/pid.ok 3 Jul 2006 20:53:34 -0000 @@ -0,0 +1,3 @@ +PID ok +PPID ok +All Done. Index: test/pid.sh =================================================================== RCS file: /cvsroot/xmlgawk/xmlgawk/test/pid.sh,v retrieving revision 1.1.1.1 diff -b -u -p -r1.1.1.1 pid.sh --- test/pid.sh 4 Jun 1997 17:18:10 -0000 1.1.1.1 +++ test/pid.sh 3 Jul 2006 20:53:34 -0000 @@ -1,5 +1,3 @@ #! /bin/sh AWK=${AWK-../gawk} -echo $$ > _pid.in -echo $1 >> _pid.in -exec $AWK -f pid.awk _pid.in 2>/dev/null +exec $AWK -v "ok_pid=$$" -v "ok_ppid=$1" -f pid.awk 2>/dev/null