Source-Changes-HG archive

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

[src/trunk]: src/regress/usr.bin The sort(1) tests have been moved to tests/u...



details:   https://anonhg.NetBSD.org/src/rev/89d6edbd336f
branches:  trunk
changeset: 756792:89d6edbd336f
user:      jmmv <jmmv%NetBSD.org@localhost>
date:      Sun Aug 01 16:44:31 2010 +0000

description:
The sort(1) tests have been moved to tests/util/sort/.

diffstat:

 regress/usr.bin/Makefile      |    4 +-
 regress/usr.bin/sort/Makefile |    8 -
 regress/usr.bin/sort/stests   |  993 ------------------------------------------
 3 files changed, 2 insertions(+), 1003 deletions(-)

diffs (truncated from 1026 to 300 lines):

diff -r 5bd7211d7708 -r 89d6edbd336f regress/usr.bin/Makefile
--- a/regress/usr.bin/Makefile  Sun Aug 01 16:43:57 2010 +0000
+++ b/regress/usr.bin/Makefile  Sun Aug 01 16:44:31 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.18 2010/07/18 10:12:33 jmmv Exp $
+#      $NetBSD: Makefile,v 1.19 2010/08/01 16:44:31 jmmv Exp $
 
 .include <bsd.own.mk>
 
@@ -6,6 +6,6 @@
 SUBDIR+= c++
 .endif
 
-SUBDIR+= rtld sort
+SUBDIR+= rtld
 
 .include <bsd.subdir.mk>
diff -r 5bd7211d7708 -r 89d6edbd336f regress/usr.bin/sort/Makefile
--- a/regress/usr.bin/sort/Makefile     Sun Aug 01 16:43:57 2010 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-#      $NetBSD: Makefile,v 1.6 2003/10/26 03:50:07 lukem Exp $
-
-NOMAN=         # defined
-
-regress:
-       @${HOST_SH} ${.CURDIR}/stests
-
-.include <bsd.prog.mk>
diff -r 5bd7211d7708 -r 89d6edbd336f regress/usr.bin/sort/stests
--- a/regress/usr.bin/sort/stests       Sun Aug 01 16:43:57 2010 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,993 +0,0 @@
-#! /bin/sh
-#      @(#)stests      8.1 (Berkeley) 6/6/93
-#      $NetBSD: stests,v 1.15 2004/02/18 09:43:15 jdolecek Exp $
-
-# This code is derived from software contributed to Berkeley by
-# Peter McIlroy.
-
-#Latest version.  My sort passes all tests because I wrote it.
-#We differ only on 25E and 25H.
-#(I found at least one bug in constructing test 25, and was driven
-#to rewrite field parsing to clarify it.)
-#
-#In 25E, -k2.3,2.1b, the fields are not necessarily out of order.
-#Even if they were, it would be legal (11752-3), although certainly
-#justification for warning.
-#
-#On 25H, your answer is as defensible as mine.  (Our suggestion
-#*1 backs mine.)
-
-
-# Tests for the Unix sort utility
-# Test Posix features except for locale.
-# Test some nonstandard features if present.
-
-# Other tests should be made for files too big to fit in memory.
-
-dict=/usr/share/dict/words
-
-# Initialize switches for nonstandard features.
-# Use parenthesized settings for supported features.
-
-o=:    # officially obsolescent features: +1 -2, misplaced -o (o=)
-g=:    # -g numeric sort including e-format numbers (g=)
-M=:    # -M sort by month names (M=)
-s=:    # -s stable, do not compare raw bytes on equal keys (s=)
-y=     # -y user-specified memory size (y=-y10000)
-S=     # -S non-stable sort
-
-# Detect what features are supported, assuming bad options cause
-# errors.  Set switches accordingly.
-
-cat <<!
-Note: some sort(1) implementations (for example GNU sort) may not pass these
-tests - this suite was made to fit sort(1) using (non-stable) radixsort(3),
-sort(1) using other algorithm may give different results, though still
-conform to standard.
-
-!
-
-echo Obsolescent and nonstandard features recognized, if any:
-if sort +0 </dev/null 2>/dev/null; then
-       o=
-       echo '  +1 -2'
-else
-       o="not_tested +POS/-POS"
-fi
-if sort /dev/null -o xx 2>/dev/null; then
-       echo '  displaced -o';
-fi
-if sort -g </dev/null 2>/dev/null; then
-       g=
-       echo '  -g g-format numbers';
-else
-       g="not_tested -g"
-fi
-if sort -M </dev/null 2>/dev/null; then
-       M=
-       echo '  -M months';
-else
-       M="not_tested -M"
-fi
-if sort -s </dev/null 2>/dev/null; then
-       s=
-       echo '  -s stable sort';
-else
-       s="not_tested -s"
-fi
-if sort -S </dev/null 2>/dev/null; then
-       S=-S
-       echo '  -S non-stable sort';
-fi
-if sort -y10000 </dev/null 2>/dev/null; then
-       y=-y10000
-       echo '  -y space';
-fi
-if sort -z10000 </dev/null 2>/dev/null; then
-       echo '  -z size (not exercised)';
-fi
-if sort -T. </dev/null 2>/dev/null; then
-       echo '  -T tempdir (not exercised)';
-fi
-
-TEST=          # major sequence number of test
-
-trap "rm -f in in1 out xx -k fields; exit" 0 1 2 13 15
-
-# some tests would fail if non-C locale is used
-unset LANG LC_ALL LC_CTYPE
-
-# xsort testno options
-# Sort file "in" with specified options.
-# Compare with file "out" if that is supplied,
-# otherwise make plausibility checks on output
-
-#      "sum" must be dumb; insensitive to the
-#      order of lines within a file.
-#      System V sum is suitable; sum -5 is the v10 equivalent.
-
-xsort () {
-       X="$1"
-       shift
-
-       if sort $S "$@" in >xx &&  sort -c $S "$@" xx 
-       then 
-               if test -f out
-               then
-                       cmp xx out >/dev/null && return 0
-                       echo "$TEST$X comparison failed - sort $@"
-               else
-                       test "`cksum -o2 <in`" = "`cksum -o2 <xx`" && return 0
-                       echo "$TEST$X checksum failed - sort $@"
-               fi
-       else
-               echo "$TEST$X failed - sort $@"
-       fi
-       return 1
-}
-
-# linecount testno file count
-# declares the given "testno" to be in error if number of
-# lines in "file" differs from "count"
-linecount() {
-       awk 'END{ if(NR!='$3') print "'$TEST$1' failed" }' $2
-}
-
-# print info about skipped test
-not_tested() {
-       echo "$TEST$X skipped - flag '$1' not supported"
-}
-
-rm -f out
-
-#---------------------------------------------------------------
-TEST=01; echo $TEST    # -c status, checksum
-                       # obsolescent features go together
-cat <<! >in
-b
-a
-!
-rm -f out -o
-
-sort $S -c in 2>/dev/null && echo ${TEST}A failed
-
-xsort B || '"cksum"' is probably unsuitable - see comments
-
-$o sort $S +0 in -o in || echo ${TEST}C failed
-
-#---------------------------------------------------------------
-TEST=02; echo $TEST    # output from -c
-cat <<! >in
-x
-y
-!
-
-sort -c $S -r in >out 2>xx && echo ${TEST}A failed
-test -s out && echo ${TEST}B failed
-test -s xx && echo option -c is noisy "(probably legal)"
-test -s xx || echo option -c is quiet "(legal, not classical)"
-
-#---------------------------------------------------------------
-TEST=03; echo $TEST    # -n
-cat <<! >in
--99.0
--99.1
--.0002
--10
-2
-0010.000000000000000000000000000000000001
-10
-3x
-x
-!
-cat <<! >out
--99.1
--99.0
--10
--.0002
-x
-2
-3x
-10
-0010.000000000000000000000000000000000001
-!
-
-xsort "" -n
-
-#---------------------------------------------------------------
-TEST=04; echo $TEST    # -b without fields, piping, -c status return
-cat <<! >in
-  b
- a
-!
-cp in out
-
-xsort A -b
-
-cat in | sort $S | cat >xx
-cmp xx out >/dev/null || echo ${TEST}B failed
-
-sort $S in | sort -c $S -r 2>/dev/null && echo ${TEST}C failed
-
-#---------------------------------------------------------------
-TEST=05; echo $TEST    # fields, reverse fields, -c status return
-cat <<! >in
-b b p
-a b q
-x a
-!
-cat <<! >out
-x a
-a b q
-b b p
-!
-
-$o xsort A +1 -2
-
-$o xsort B +1 -2 +2r
-
-xsort C -k 2,2
-
-xsort D -k 2,2 -k 3r
-
-xsort E -k 2,2.0
-
-xsort F -k 2,2 -k 1,1 -k 3
-
-sort -c $S -k 2 in 2>/dev/null && echo ${TEST}G failed
-
-#---------------------------------------------------------------
-TEST=06; echo $TEST    # -t
-cat <<! >in
-a:
-a!
-!
-cp in out
-
-$o xsort A -t : -r +0
-
-$o xsort B -t : +0 -1
-
-xsort C -t : -r -k 1
-
-xsort D -t : -k 1,1
-
-#---------------------------------------------------------------
-TEST=07; echo $TEST    # -t, character positions in fields
-       # -t: as 1 arg is not strictly conforming, but classical
-cat <<! >in
-: ab
-:bac
-!
-cat <<! >out
-:bac
-: ab
-!
-
-$o xsort A -b -t: +1.1



Home | Main Index | Thread Index | Old Index