Move all tests from test/{od,sha1sum,shred,stty} to tests/misc/.

Reflect these renamings:
od/od-N             misc/od-N
od/x8               misc/od-x8
sha1sum/basic-1     misc/sha1sum
sha1sum/sample-vec  misc/sha1sum-vec
shred/exact         misc/shred-exact
shred/remove        misc/shred-remove
stty/basic-1        misc/stty
stty/invalid        misc/stty-invalid
stty/row-col-1      misc/stty-row-col

* tests/misc/Makefile.am (TESTS): Add the new files.
* tests/Makefile.am (SUBDIRS): Remove the dir names.
* tests/od, tests/sha1sum, tests/shred, tests/stty: Remove the directories.
* configure.ac (AC_CONFIG_FILES): Remove the corresponding Makefile names.
This commit is contained in:
Jim Meyering 2007-09-11 23:30:49 +02:00
parent 44629cf147
commit 0539705768
18 changed files with 37 additions and 142 deletions

View File

@ -8,4 +8,4 @@ ChangeLog
^lib/group-member\.c$
^Makefile\.maint$
^doc/coreutils.texi$
^tests/stty/invalid$
^tests/misc/stty-invalid$

View File

@ -352,15 +352,11 @@ AC_CONFIG_FILES(
tests/misc/Makefile
tests/mkdir/Makefile
tests/mv/Makefile
tests/od/Makefile
tests/pr/Makefile
tests/readlink/Makefile
tests/rm/Makefile
tests/rmdir/Makefile
tests/sha1sum/Makefile
tests/shred/Makefile
tests/sort/Makefile
tests/stty/Makefile
tests/tac/Makefile
tests/tail-2/Makefile
tests/tail/Makefile

View File

@ -45,8 +45,8 @@ EXTRA_DIST = \
## There are too many already. Put new tests in misc/.
SUBDIRS = \
chgrp chmod chown cp cut dd du head \
install join ln ls ls-2 misc mkdir mv od pr readlink rm rmdir \
sha1sum shred sort stty tac tail tail-2 test touch tr \
install join ln ls ls-2 misc mkdir mv pr readlink rm rmdir \
sort tac tail tail-2 test touch tr \
uniq wc
## N O T E :: Please do not add new directories.

View File

@ -81,6 +81,8 @@ TESTS = \
nice \
nl \
nohup \
od-N \
od-x8 \
paste-no-nl \
pathchk1 \
printf \
@ -88,10 +90,14 @@ TESTS = \
pwd-long \
runcon-no-reorder \
seq \
sha1sum \
sha1sum-vec \
sha224sum \
sha256sum \
sha384sum \
sha512sum \
shred-exact \
shred-remove \
shuf \
sort-compress \
sort-merge \
@ -101,6 +107,9 @@ TESTS = \
split-l \
stat-fmt \
stat-printf \
stty \
stty-invalid \
stty-row-col \
sum \
sum-sysv \
tac-continue \
@ -111,4 +120,5 @@ TESTS = \
tty-eof \
unexpand
include $(top_srcdir)/tests/check.mk

View File

@ -124,7 +124,4 @@ EOF
fail=1
fi
cd ..
rm -rf $tmp
exit $fail

View File

@ -1,7 +1,7 @@
#!/bin/sh
# Verify that `od -N N' reads no more than N bytes of input.
# Copyright (C) 2001, 2004, 2005, 2006 Free Software Foundation, Inc.
# Copyright (C) 2001, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -21,20 +21,9 @@ if test "$VERBOSE" = yes; then
od --version
fi
pwd=`pwd`
tmp=od-N.$$
trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
. $srcdir/../test-lib.sh
framework_failure=0
mkdir $tmp || framework_failure=1
cd $tmp || framework_failure=1
echo abcdefg > in || framework_failure=1
if test $framework_failure = 1; then
echo 'failure in testing framework' 1>&2
(exit 1); exit 1
fi
echo abcdefg > in || framework_failure
fail=0
@ -43,9 +32,6 @@ cat <<EOF > exp || fail=1
a b c
d e f
EOF
cmp out exp || {
fail=1
diff out exp 2> /dev/null
}
compare out exp || fail=1
(exit $fail); exit $fail

View File

@ -2,7 +2,7 @@
# verify that od -t x8 works properly
# This would fail before coreutils-4.5.2.
# Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
# Copyright (C) 2002, 2005-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -22,25 +22,14 @@ if test "$VERBOSE" = yes; then
od --version
fi
. $srcdir/../test-lib.sh
od -t x8 /dev/null >/dev/null || {
echo >&2 "$0: 8-byte test skipped"
exit 77
}
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
mkdir -p $tmp || framework_failure=1
cd $tmp || framework_failure=1
echo abcdefgh |tr -d '\n' > in || framework_failure=1
if test $framework_failure = 1; then
echo "$0: failure in testing framework" 1>&2
(exit 1); exit 1
fi
echo abcdefgh |tr -d '\n' > in || framework_failure
fail=0
@ -56,7 +45,6 @@ od -An -t x1 in \
| sort -n \
> exp
cmp out exp || fail=1
test $fail = 1 && diff out exp 2> /dev/null
compare out exp || fail=1
(exit $fail); exit $fail

View File

@ -1,7 +1,7 @@
#!/bin/sh
# Test "sha1sum".
# Copyright (C) 2000, 2003, 2005, 2006 Free Software Foundation, Inc.
# Copyright (C) 2000, 2003, 2005-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -84,7 +84,7 @@ foreach $t (@Tests)
my $save_temps = $ENV{DEBUG};
my $verbose = $ENV{VERBOSE};
my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
my $prog = 'sha1sum';
my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
exit $fail;
EOF

View File

@ -1,7 +1,7 @@
#!/bin/sh
# Sample vectors for "sha1sum".
# Copyright (C) 2000, 2001, 2003, 2005 Free Software Foundation, Inc.
# Copyright (C) 2000, 2001, 2003, 2005, 2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -541,7 +541,7 @@ foreach $t (@Tests)
my $save_temps = $ENV{DEBUG};
my $verbose = $ENV{VERBOSE};
my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
my $prog = 'sha1sum';
my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
exit $fail;
EOF

View File

@ -1,7 +1,7 @@
#!/bin/sh
# make sure that neither --exact nor --zero gobbles a command line argument
# Copyright (C) 2000, 2003, 2004, 2006 Free Software Foundation, Inc.
# Copyright (C) 2000, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -21,19 +21,7 @@ if test "$VERBOSE" = yes; then
shred --version
fi
pwd=`pwd`
tmp=exact.$$
trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
framework_failure=0
mkdir $tmp || framework_failure=1
cd $tmp || framework_failure=1
if test $framework_failure = 1; then
echo 'failure in testing framework'
(exit 1); exit 1
fi
. $srcdir/../test-lib.sh
fail=0

View File

@ -1,7 +1,7 @@
#!/bin/sh
# Exercise a bug that was fixed in shred-4.0l
# Copyright (C) 1999, 2000, 2003, 2006 Free Software Foundation, Inc.
# Copyright (C) 1999, 2000, 2003, 2006, 2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -22,27 +22,14 @@ if test "$VERBOSE" = yes; then
fi
PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
mkdir -p $tmp || framework_failure=1
cd $tmp || framework_failure=1
. $srcdir/../test-lib.sh
# The length of the basename is what matters.
# In this case, shred would try to rename the file 256^10 times
# before terminating.
file=0123456789
touch $file || framework_failure=1
chmod u-w $file || framework_failure=1
if test $framework_failure = 1; then
echo 'failure in testing framework'
exit 1
fi
touch $file || framework_failure
chmod u-w $file || framework_failure
fail=0

View File

@ -1,8 +1,7 @@
#! /bin/sh
# Make sure stty can parse most of its options.
# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free
# Software Foundation, Inc.
# Copyright (C) 1998-2004, 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -24,6 +23,7 @@ fi
# Make sure there's a tty on stdin.
. $srcdir/../input-tty
. $srcdir/../test-lib.sh
# The following list of reversible options was generated with
# grep -w REV stty.c|sed -n '/^ {"/{s//REV_/;s/".*/=1/;p;}'|fmt
@ -99,6 +99,5 @@ if test -n "$RUN_LONG_TESTS"; then
fi
stty `cat $saved_state`
rm -f $saved_state
exit $fail

View File

@ -23,20 +23,7 @@ fi
# Make sure there's a tty on stdin.
. $srcdir/../input-tty
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
trap '(exit $?); exit $?' 1 2 13 15
framework_failure=0
mkdir -p $tmp || framework_failure=1
cd $tmp || framework_failure=1
if test $framework_failure = 1; then
echo "$0: failure in testing framework" 1>&2
(exit 1); exit 1
fi
. $srcdir/../test-lib.sh
fail=0

View File

@ -1,8 +1,7 @@
#! /bin/sh
# Test "stty" with rows and columns.
# Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 Free
# Software Foundation, Inc.
# Copyright (C) 1998-2001, 2003-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -39,6 +38,7 @@ export LC_ALL
# Make sure there's a tty on stdin.
. $srcdir/../input-tty
. $srcdir/../test-lib.sh
# Versions of GNU stty from shellutils-1.9.2c and earlier failed
# tests #2 and #4 when run on SunOS 4.1.3.

View File

@ -1,12 +0,0 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = \
top_srcdir=$(top_srcdir) \
srcdir=$(srcdir) \
PERL="$(PERL)" \
CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \
PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
TESTS = od-N x8

View File

@ -1,13 +0,0 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = \
top_srcdir=$(top_srcdir) \
srcdir=$(srcdir) \
PERL="$(PERL)" \
CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \
PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH" \
PROG=sha1sum
TESTS = basic-1 sample-vec

View File

@ -1,12 +0,0 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = \
top_srcdir=$(top_srcdir) \
srcdir=$(srcdir) \
PERL="$(PERL)" \
CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \
PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
TESTS = remove exact

View File

@ -1,6 +0,0 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
TESTS = invalid row-col-1 basic-1
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = \
CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \
PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH"