summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-09-11 23:30:49 +0200
committerJim Meyering <jim@meyering.net>2007-09-15 08:40:39 +0200
commit0539705768992ebcc290bc859f64e27898c7f958 (patch)
tree9e49d8f9aca7097cdff462da3e67cbc2ac941cda /tests
parent44629cf147ba5c3827b5252e36ce50ce447b36b8 (diff)
downloadcoreutils-0539705768992ebcc290bc859f64e27898c7f958.tar.xz
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am4
-rw-r--r--tests/misc/Makefile.am10
-rwxr-xr-xtests/misc/ls-time3
-rwxr-xr-xtests/misc/od-N (renamed from tests/od/od-N)22
-rwxr-xr-xtests/misc/od-x8 (renamed from tests/od/x8)22
-rwxr-xr-xtests/misc/sha1sum (renamed from tests/sha1sum/basic-1)4
-rwxr-xr-xtests/misc/sha1sum-vec (renamed from tests/sha1sum/sample-vec)4
-rwxr-xr-xtests/misc/shred-exact (renamed from tests/shred/exact)16
-rwxr-xr-xtests/misc/shred-remove (renamed from tests/shred/remove)21
-rwxr-xr-xtests/misc/stty (renamed from tests/stty/basic-1)5
-rwxr-xr-xtests/misc/stty-invalid (renamed from tests/stty/invalid)15
-rwxr-xr-xtests/misc/stty-row-col (renamed from tests/stty/row-col-1)4
-rw-r--r--tests/od/Makefile.am12
-rw-r--r--tests/sha1sum/Makefile.am13
-rw-r--r--tests/shred/Makefile.am12
-rw-r--r--tests/stty/Makefile.am6
16 files changed, 36 insertions, 137 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b1865b369..d3cfb930f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -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.
diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am
index 699835309..a08b7192c 100644
--- a/tests/misc/Makefile.am
+++ b/tests/misc/Makefile.am
@@ -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
diff --git a/tests/misc/ls-time b/tests/misc/ls-time
index 4099e6b99..7aee5809f 100755
--- a/tests/misc/ls-time
+++ b/tests/misc/ls-time
@@ -124,7 +124,4 @@ EOF
fail=1
fi
-cd ..
-rm -rf $tmp
-
exit $fail
diff --git a/tests/od/od-N b/tests/misc/od-N
index 341ff0af4..0cff509f7 100755
--- a/tests/od/od-N
+++ b/tests/misc/od-N
@@ -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
diff --git a/tests/od/x8 b/tests/misc/od-x8
index 0f33f58a9..dc1ec00cb 100755
--- a/tests/od/x8
+++ b/tests/misc/od-x8
@@ -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
diff --git a/tests/sha1sum/basic-1 b/tests/misc/sha1sum
index 7cee37e41..975c570f5 100755
--- a/tests/sha1sum/basic-1
+++ b/tests/misc/sha1sum
@@ -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
diff --git a/tests/sha1sum/sample-vec b/tests/misc/sha1sum-vec
index fa83aed55..d20904168 100755
--- a/tests/sha1sum/sample-vec
+++ b/tests/misc/sha1sum-vec
@@ -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
diff --git a/tests/shred/exact b/tests/misc/shred-exact
index eee2112e3..e0fef3974 100755
--- a/tests/shred/exact
+++ b/tests/misc/shred-exact
@@ -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
diff --git a/tests/shred/remove b/tests/misc/shred-remove
index 4afa63b90..ae7443b18 100755
--- a/tests/shred/remove
+++ b/tests/misc/shred-remove
@@ -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
diff --git a/tests/stty/basic-1 b/tests/misc/stty
index 160e436ba..c9fd67d14 100755
--- a/tests/stty/basic-1
+++ b/tests/misc/stty
@@ -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
diff --git a/tests/stty/invalid b/tests/misc/stty-invalid
index 93789345f..a2a636d06 100755
--- a/tests/stty/invalid
+++ b/tests/misc/stty-invalid
@@ -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
diff --git a/tests/stty/row-col-1 b/tests/misc/stty-row-col
index 65fc91e32..3fb387183 100755
--- a/tests/stty/row-col-1
+++ b/tests/misc/stty-row-col
@@ -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.
diff --git a/tests/od/Makefile.am b/tests/od/Makefile.am
deleted file mode 100644
index 21396a96b..000000000
--- a/tests/od/Makefile.am
+++ /dev/null
@@ -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
diff --git a/tests/sha1sum/Makefile.am b/tests/sha1sum/Makefile.am
deleted file mode 100644
index 920dd1a9a..000000000
--- a/tests/sha1sum/Makefile.am
+++ /dev/null
@@ -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
diff --git a/tests/shred/Makefile.am b/tests/shred/Makefile.am
deleted file mode 100644
index 190cc4b47..000000000
--- a/tests/shred/Makefile.am
+++ /dev/null
@@ -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
diff --git a/tests/stty/Makefile.am b/tests/stty/Makefile.am
deleted file mode 100644
index b3c460eb9..000000000
--- a/tests/stty/Makefile.am
+++ /dev/null
@@ -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"