summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/misc/Makefile.am2
-rwxr-xr-xtests/misc/sum (renamed from tests/sum/basic-1)4
-rwxr-xr-xtests/misc/sum-sysv (renamed from tests/sum/sysv)22
-rw-r--r--tests/sum/Makefile.am13
5 files changed, 9 insertions, 34 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f942dcd91..222dbe61b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -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.
diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am
index 6b7d279c3..0d283b342 100644
--- a/tests/misc/Makefile.am
+++ b/tests/misc/Makefile.am
@@ -101,6 +101,8 @@ TESTS = \
split-l \
stat-fmt \
stat-printf \
+ sum \
+ sum-sysv \
tac-continue \
test-diag \
tsort \
diff --git a/tests/sum/basic-1 b/tests/misc/sum
index c3da694b4..527170798 100755
--- a/tests/sum/basic-1
+++ b/tests/misc/sum
@@ -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
diff --git a/tests/sum/sysv b/tests/misc/sum-sysv
index 090a0ad53..5181cff0a 100755
--- a/tests/sum/sysv
+++ b/tests/misc/sum-sysv
@@ -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
index 6b6cedd9a..000000000
--- a/tests/sum/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=sum
-
-TESTS = basic-1 sysv