From: Jim Meyering Date: Mon, 10 Sep 2007 22:43:05 +0000 (+0200) Subject: Move the two tests in tests/sum/ to tests/misc/. X-Git-Tag: v6.9.89~120 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb3f59b7e1fece055a51ef724c63edac56ab9636;p=platform%2Fupstream%2Fcoreutils.git Move the two tests in tests/sum/ to tests/misc/. * 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. --- diff --git a/configure.ac b/configure.ac index e79a351..dc9436f 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/tests/Makefile.am b/tests/Makefile.am index f942dcd..222dbe6 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 6b7d279..0d283b3 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 similarity index 94% rename from tests/sum/basic-1 rename to tests/misc/sum index c3da694..5271707 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 similarity index 75% rename from tests/sum/sysv rename to tests/misc/sum-sysv index 090a0ad..5181cff 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 6b6cedd..0000000 --- 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