Move all tests from test/{od,sha1sum,shred,stty} to tests/misc/.
authorJim Meyering <jim@meyering.net>
Tue, 11 Sep 2007 21:30:49 +0000 (23:30 +0200)
committerJim Meyering <jim@meyering.net>
Sat, 15 Sep 2007 06:40:39 +0000 (08:40 +0200)
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.

18 files changed:
.x-sc_prohibit_atoi_atof
configure.ac
tests/Makefile.am
tests/misc/Makefile.am
tests/misc/ls-time
tests/misc/od-N [moved from tests/od/od-N with 65% similarity]
tests/misc/od-x8 [moved from tests/od/x8 with 66% similarity]
tests/misc/sha1sum [moved from tests/sha1sum/basic-1 with 95% similarity]
tests/misc/sha1sum-vec [moved from tests/sha1sum/sample-vec with 99% similarity]
tests/misc/shred-exact [moved from tests/shred/exact with 74% similarity]
tests/misc/shred-remove [moved from tests/shred/remove with 70% similarity]
tests/misc/stty [moved from tests/stty/basic-1 with 96% similarity]
tests/misc/stty-invalid [moved from tests/stty/invalid with 82% similarity]
tests/misc/stty-row-col [moved from tests/stty/row-col-1 with 96% similarity]
tests/od/Makefile.am [deleted file]
tests/sha1sum/Makefile.am [deleted file]
tests/shred/Makefile.am [deleted file]
tests/stty/Makefile.am [deleted file]

index c7b8603..40feeb7 100644 (file)
@@ -8,4 +8,4 @@ ChangeLog
 ^lib/group-member\.c$
 ^Makefile\.maint$
 ^doc/coreutils.texi$
-^tests/stty/invalid$
+^tests/misc/stty-invalid$
index 8743729..3240bd5 100644 (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
index b1865b3..d3cfb93 100644 (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.
 
index 6998353..a08b719 100644 (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
index 4099e6b..7aee580 100755 (executable)
@@ -124,7 +124,4 @@ EOF
   fail=1
 fi
 
-cd ..
-rm -rf $tmp
-
 exit $fail
similarity index 65%
rename from tests/od/od-N
rename to tests/misc/od-N
index 341ff0a..0cff509 100755 (executable)
@@ -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
similarity index 66%
rename from tests/od/x8
rename to tests/misc/od-x8
index 0f33f58..dc1ec00 100755 (executable)
@@ -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
similarity index 95%
rename from tests/sha1sum/basic-1
rename to tests/misc/sha1sum
index 7cee37e..975c570 100755 (executable)
@@ -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
similarity index 99%
rename from tests/sha1sum/sample-vec
rename to tests/misc/sha1sum-vec
index fa83aed..d209041 100755 (executable)
@@ -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
similarity index 74%
rename from tests/shred/exact
rename to tests/misc/shred-exact
index eee2112..e0fef39 100755 (executable)
@@ -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
 
similarity index 70%
rename from tests/shred/remove
rename to tests/misc/shred-remove
index 4afa63b..ae7443b 100755 (executable)
@@ -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
 
similarity index 96%
rename from tests/stty/basic-1
rename to tests/misc/stty
index 160e436..c9fd67d 100755 (executable)
@@ -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
similarity index 82%
rename from tests/stty/invalid
rename to tests/misc/stty-invalid
index 9378934..a2a636d 100755 (executable)
@@ -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
 
similarity index 96%
rename from tests/stty/row-col-1
rename to tests/misc/stty-row-col
index 65fc91e..3fb3871 100755 (executable)
@@ -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 (file)
index 21396a9..0000000
+++ /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 (file)
index 920dd1a..0000000
+++ /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 (file)
index 190cc4b..0000000
+++ /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 (file)
index b3c460e..0000000
+++ /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"