Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/regress/lib/libc/servent The servent test has been atf-ified



details:   https://anonhg.NetBSD.org/src/rev/3d06d2c1c7ce
branches:  trunk
changeset: 760340:3d06d2c1c7ce
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Mon Jan 03 00:55:18 2011 +0000

description:
The servent test has been atf-ified

diffstat:

 regress/lib/libc/servent/compare |  85 ----------------------------------------
 1 files changed, 0 insertions(+), 85 deletions(-)

diffs (89 lines):

diff -r 334ff51c3b7a -r 3d06d2c1c7ce regress/lib/libc/servent/compare
--- a/regress/lib/libc/servent/compare  Sun Jan 02 22:10:23 2011 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-#!/bin/sh
-# compare - compare output
-# usage: compare original-servent-file reader-program
-#
-# $NetBSD: compare,v 1.4 2008/03/09 01:31:07 dholland Exp $
-#
-
-REF=reference-output
-OBS=observed-output
-DIFFS=differences
-
-if [ $# != 2 ]; then
-    echo "$0: usage: $0 original-servent-file reader-program" 1>&2
-    exit 1
-fi
-if [ ! -f "$1" ]; then
-    echo "$0: $1 missing" 1>&2
-    exit 1
-fi
-if [ ! -x "$2" ]; then
-    echo "$0: $2 missing" 1>&2
-    exit 1
-fi
-
-#
-# Munge original to:
-#  (1) match output format of the test program
-#  (2) fold all names for the same port/proto together
-#  (3) prune duplicates
-#
-tr '\t' ' ' < "$1" | awk '
-    function add(key, name,      i, n, ar) {
-       n = split(names[key], ar);
-       for (i=1; i<=n; i++) {
-           if (name == ar[i]) {
-               return;
-           }
-       }
-       delete ar;
-       names[key] = names[key] " " name;
-    }
-
-    {
-       sub("#.*", "", $0);
-       gsub("  *", " ", $0);
-       if (NF==0) {
-           next;
-       }
-       add($2, $1, 0);
-       for (i=3; i<=NF; i++) {
-           add($2, $i, 1);
-       }
-    }
-    END {
-       for (key in names) {
-           portproto = key;
-           sub("/", ", proto=", portproto);
-           portproto = "port=" portproto;
-
-           n = split(names[key], ar);
-           printf "name=%s, %s, aliases=", ar[1], portproto;
-           for (i=2; i<=n; i++) {
-               if (i>2) {
-                   printf " ";
-               }
-               printf "%s", ar[i];
-           }
-           printf "\n";
-           delete ar;
-       }
-    }
-' | sort > $REF
-
-# run test program
-$2 | sed 's/ *$//' | sort > $OBS
-
-diff $REF $OBS >$DIFFS 2>&1
-
-if [ -s $DIFFS ]; then
-       echo "servent: Observed output does not match reference output" 1>&2
-       echo "servent: Outputs left in `pwd`" 1>&2
-       exit 1
-fi
-rm -f $REF $OBS $DIFFS
-exit 0



Home | Main Index | Thread Index | Old Index