Move the two tests in tests/sum/ to tests/misc/.
authorJim Meyering <jim@meyering.net>
Mon, 10 Sep 2007 22:43:05 +0000 (00:43 +0200)
committerJim Meyering <jim@meyering.net>
Sat, 15 Sep 2007 06:40:39 +0000 (08:40 +0200)
* tests/sum/basic-1: Move this file to ...
* tests/misc/sum: ...here.  Don't rely on $PROG in env.
* tests/sum/sysv: Move this file to ...
* tests/misc/sum-sysv: ...here.  Adapt it to use test-lib.sh.
* tests/misc/Makefile.am (TESTS): Add sum and sum-sysv.
* tests/Makefile.am (SUBDIRS): Remove sum.
* tests/sum: Remove the directory.
* configure.ac (AC_CONFIG_FILES): Remove tests/sum/Makefile.

configure.ac
tests/Makefile.am
tests/misc/Makefile.am
tests/misc/sum [moved from tests/sum/basic-1 with 94% similarity]
tests/misc/sum-sysv [moved from tests/sum/sysv with 75% similarity]
tests/sum/Makefile.am [deleted file]

index e79a351..dc9436f 100644 (file)
@@ -361,7 +361,6 @@ AC_CONFIG_FILES(
   tests/shred/Makefile
   tests/sort/Makefile
   tests/stty/Makefile
-  tests/sum/Makefile
   tests/tac/Makefile
   tests/tail-2/Makefile
   tests/tail/Makefile
index f942dcd..222dbe6 100644 (file)
@@ -46,7 +46,7 @@ EXTRA_DIST =          \
 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 sum tac tail tail-2 tee test touch tr \
+  sha1sum shred sort stty tac tail tail-2 tee test touch tr \
   uniq wc
 ## N O T E :: Please do not add new directories.
 
index 6b7d279..0d283b3 100644 (file)
@@ -101,6 +101,8 @@ TESTS = \
   split-l \
   stat-fmt \
   stat-printf \
+  sum \
+  sum-sysv \
   tac-continue \
   test-diag \
   tsort \
similarity index 94%
rename from tests/sum/basic-1
rename to tests/misc/sum
index c3da694..5271707 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Test "sum".
 
-# 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
@@ -68,7 +68,7 @@ my @Tests =
 my $save_temps = $ENV{DEBUG};
 my $verbose = $ENV{VERBOSE};
 
-my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
+my $prog = 'sum';
 my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
 exit $fail;
 EOF
similarity index 75%
rename from tests/sum/sysv
rename to tests/misc/sum-sysv
index 090a0ad..5181cff 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # make sure `sum -s' works for input whose sum of bytes is larger than 2^32
 
-# Copyright (C) 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2001-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
@@ -33,19 +33,7 @@ $PERL -e 1 > /dev/null 2>&1 || {
 LC_ALL=C
 export LC_ALL
 
-pwd=`pwd`
-tmp=sum-s.$$
-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' 1>&2
-  (exit 1); exit 1
-fi
+. $srcdir/../test-lib.sh
 
 fail=0
 
@@ -57,8 +45,7 @@ $PERL -e '$s = chr(255) x 65537; foreach (1..257) {print $s}' \
 cat > exp <<\EOF
 65535 32897
 EOF
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
 
 rm -f out exp
 
@@ -68,7 +55,6 @@ $PERL -e '$s = chr(255) x 65537; foreach (1..257) {print $s}; print chr(255)' \
 cat > exp <<\EOF
 254 32897
 EOF
-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/sum/Makefile.am b/tests/sum/Makefile.am
deleted file mode 100644 (file)
index 6b6cedd..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=sum
-
-TESTS = basic-1 sysv