diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/misc/Makefile.am | 16 | ||||
-rwxr-xr-x | tests/misc/base64 | 2 | ||||
-rwxr-xr-x | tests/misc/basename | 4 | ||||
-rwxr-xr-x | tests/misc/cut | 6 | ||||
-rwxr-xr-x | tests/misc/dirname | 2 | ||||
-rwxr-xr-x | tests/misc/expand | 4 | ||||
-rwxr-xr-x | tests/misc/fold | 2 | ||||
-rwxr-xr-x | tests/misc/sha224sum | 4 | ||||
-rwxr-xr-x | tests/misc/sha256sum | 4 | ||||
-rwxr-xr-x | tests/misc/sha384sum | 4 | ||||
-rwxr-xr-x | tests/misc/sha512sum | 4 | ||||
-rwxr-xr-x | tests/misc/wc-files0-from | 20 |
12 files changed, 48 insertions, 24 deletions
diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am index f4e41df8f..236fb7f04 100644 --- a/tests/misc/Makefile.am +++ b/tests/misc/Makefile.am @@ -24,6 +24,7 @@ TESTS_ENVIRONMENT = \ built_programs="`$(built_programs)`" \ top_srcdir=$(top_srcdir) \ abs_top_builddir=$(abs_top_builddir) \ + abs_top_srcdir=$(abs_top_srcdir) \ srcdir=$(srcdir) \ PACKAGE_VERSION=$(PACKAGE_VERSION) \ PERL="$(PERL)" \ @@ -32,8 +33,7 @@ TESTS_ENVIRONMENT = \ PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH" \ CONFIG_HEADER=$(CONFIG_HEADER) \ REPLACE_GETCWD=$(REPLACE_GETCWD) \ - host_os=$(host_os) \ - PROG=`../../src/basename -- "$$tst"` + host_os=$(host_os) # Do not choose a name that is a shell keyword like 'if', or a # commonly-used utility like 'cat' or 'test', as the name of a test. @@ -42,8 +42,10 @@ TESTS_ENVIRONMENT = \ # will execute the test script rather than the standard utility. TESTS = \ - od \ + head-elide-tail \ + date \ xstrtol \ + od \ arch \ pr \ df-P \ @@ -59,7 +61,6 @@ TESTS = \ basename \ close-stdout \ csplit \ - date \ date-sec \ df \ dirname \ @@ -68,7 +69,6 @@ TESTS = \ fold \ groups-version \ head-c \ - head-elide-tail \ head-pos \ mknod \ nice \ @@ -96,3 +96,9 @@ TESTS = \ tac-continue \ test-diag \ tty-eof + +TEST_LOGS = $(TESTS:=.log) + +# Parallel replacement of Automake's check-TESTS target. +# Include it last: TEST_LOGS has a default value there. +include $(top_srcdir)/build-aux/check.mk diff --git a/tests/misc/base64 b/tests/misc/base64 index 592d11391..56c5e2427 100755 --- a/tests/misc/base64 +++ b/tests/misc/base64 @@ -20,6 +20,8 @@ : ${PERL=perl} : ${srcdir=.} +PROG=`echo $0|sed 's,.*/,,'`; export PROG + $PERL -e 1 > /dev/null 2>&1 || { echo 1>&2 "$0: configure didn't find a usable version of Perl," \ "so can't run this test" diff --git a/tests/misc/basename b/tests/misc/basename index e4c145d17..07b118559 100755 --- a/tests/misc/basename +++ b/tests/misc/basename @@ -1,7 +1,7 @@ #!/bin/sh # -*-perl-*- -# Copyright (C) 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 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 @@ -19,6 +19,8 @@ : ${PERL=perl} : ${srcdir=.} +PROG=`echo $0|sed 's,.*/,,'`; export PROG + $PERL -e 1 > /dev/null 2>&1 || { echo 1>&2 "$0: configure didn't find a usable version of Perl," \ "so can't run this test" diff --git a/tests/misc/cut b/tests/misc/cut index 40ae2cb31..be2378250 100755 --- a/tests/misc/cut +++ b/tests/misc/cut @@ -36,10 +36,10 @@ use strict; @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; my $prog = 'cut'; -my $diag = <<EOF; +my $diag = <<DIAG_EOF; $prog: fields and positions are numbered from 1 Try \`cut --help' for more information. -EOF +DIAG_EOF my @Tests = ( @@ -60,4 +60,4 @@ my $verbose = $ENV{VERBOSE}; my $fail = run_tests ($ME, $prog, \@Tests, $save_temps, $verbose); exit $fail; -FILE_EOF +EOF diff --git a/tests/misc/dirname b/tests/misc/dirname index d88c9a953..7d0ffda8a 100755 --- a/tests/misc/dirname +++ b/tests/misc/dirname @@ -20,6 +20,8 @@ : ${PERL=perl} : ${srcdir=.} +PROG=`echo $0|sed 's,.*/,,'`; export PROG + $PERL -e 1 > /dev/null 2>&1 || { echo 1>&2 "$0: configure didn't find a usable version of Perl," \ "so can't run this test" diff --git a/tests/misc/expand b/tests/misc/expand index dff13b8d8..7772fefe7 100755 --- a/tests/misc/expand +++ b/tests/misc/expand @@ -2,7 +2,7 @@ # -*- perl -*- # Exercise expand. -# Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2004-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 @@ -20,6 +20,8 @@ : ${PERL=perl} : ${srcdir=.} +PROG=`echo $0|sed 's,.*/,,'`; export PROG + $PERL -e 1 > /dev/null 2>&1 || { echo 1>&2 "$0: configure didn't find a usable version of Perl," \ "so can't run this test" diff --git a/tests/misc/fold b/tests/misc/fold index 343279603..df017019e 100755 --- a/tests/misc/fold +++ b/tests/misc/fold @@ -20,6 +20,8 @@ : ${PERL=perl} : ${srcdir=.} +PROG=`echo $0|sed 's,.*/,,'`; export PROG + $PERL -e 1 > /dev/null 2>&1 || { echo 1>&2 "$0: configure didn't find a usable version of Perl," \ "so can't run this test" diff --git a/tests/misc/sha224sum b/tests/misc/sha224sum index d7d55952e..220a49864 100755 --- a/tests/misc/sha224sum +++ b/tests/misc/sha224sum @@ -1,7 +1,7 @@ #!/bin/sh # Test "sha224sum". -# Copyright (C) 2005 Free Software Foundation, Inc. +# Copyright (C) 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 @@ -19,6 +19,8 @@ : ${PERL=perl} : ${srcdir=.} +PROG=`echo $0|sed 's,.*/,,'`; export PROG + $PERL -e 1 > /dev/null 2>&1 || { echo 1>&2 "$0: configure didn't find a usable version of Perl," \ "so can't run this test" diff --git a/tests/misc/sha256sum b/tests/misc/sha256sum index 906b1e899..2d6a0d963 100755 --- a/tests/misc/sha256sum +++ b/tests/misc/sha256sum @@ -1,7 +1,7 @@ #!/bin/sh # Test "sha256sum". -# Copyright (C) 2005 Free Software Foundation, Inc. +# Copyright (C) 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 @@ -19,6 +19,8 @@ : ${PERL=perl} : ${srcdir=.} +PROG=`echo $0|sed 's,.*/,,'`; export PROG + $PERL -e 1 > /dev/null 2>&1 || { echo 1>&2 "$0: configure didn't find a usable version of Perl," \ "so can't run this test" diff --git a/tests/misc/sha384sum b/tests/misc/sha384sum index c37ba8a35..1d3aff003 100755 --- a/tests/misc/sha384sum +++ b/tests/misc/sha384sum @@ -1,7 +1,7 @@ #!/bin/sh # Test "sha384sum". -# Copyright (C) 2005 Free Software Foundation, Inc. +# Copyright (C) 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 @@ -19,6 +19,8 @@ : ${PERL=perl} : ${srcdir=.} +PROG=`echo $0|sed 's,.*/,,'`; export PROG + $PERL -e 1 > /dev/null 2>&1 || { echo 1>&2 "$0: configure didn't find a usable version of Perl," \ "so can't run this test" diff --git a/tests/misc/sha512sum b/tests/misc/sha512sum index 52a2ca5dc..74deec5f3 100755 --- a/tests/misc/sha512sum +++ b/tests/misc/sha512sum @@ -1,7 +1,7 @@ #!/bin/sh # Test "sha512sum". -# Copyright (C) 2005 Free Software Foundation, Inc. +# Copyright (C) 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 @@ -19,6 +19,8 @@ : ${PERL=perl} : ${srcdir=.} +PROG=`echo $0|sed 's,.*/,,'`; export PROG + $PERL -e 1 > /dev/null 2>&1 || { echo 1>&2 "$0: configure didn't find a usable version of Perl," \ "so can't run this test" diff --git a/tests/misc/wc-files0-from b/tests/misc/wc-files0-from index eab8c6ece..53511c84a 100755 --- a/tests/misc/wc-files0-from +++ b/tests/misc/wc-files0-from @@ -23,6 +23,8 @@ . $srcdir/../envvar-check +PROG=`echo $0|sed 's,.*/,,'`; export PROG + $PERL -e 1 > /dev/null 2>&1 || { echo 1>&2 "$0: configure didn't find a usable version of Perl," \ "so can't run this test" @@ -37,8 +39,7 @@ use strict; (my $program_name = $0) =~ s|.*/||; -$ENV{PROG} = 'wc'; -my $ME = $ENV{PROG}; +my $prog = 'wc'; # Turn off localization of executable's ouput. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; @@ -47,14 +48,14 @@ my @Tests = ( # invalid extra command line argument ['f-extra-arg', '--files0-from=- no-such', {IN=>"a"}, {EXIT=>1}, - {ERR => "$ME: extra operand `no-such'\n" + {ERR => "$prog: extra operand `no-such'\n" . "File operands cannot be combined with --files0-from.\n" - . "Try `$ME --help' for more information.\n"} + . "Try `$prog --help' for more information.\n"} ], # missing input file ['missing', '--files0-from=missing', {EXIT=>1}, - {ERR => "$ME: cannot open `missing' for reading: " + {ERR => "$prog: cannot open `missing' for reading: " . "No such file or directory\n"}], # empty input @@ -65,13 +66,13 @@ my @Tests = # one NUL ['nul-1', '--files0-from=-', '<', {IN=>"\0"}, {EXIT=>1}, - {ERR => "$ME: : No such file or directory\n"}], + {ERR => "$prog: : No such file or directory\n"}], # two NULs ['nul-2', '--files0-from=-', '<', {IN=>"\0\0"}, {EXIT=>1}, {OUT=>"0 0 0 total\n"}, - {ERR => "$ME: : No such file or directory\n" - . "$ME: : No such file or directory\n"}], + {ERR => "$prog: : No such file or directory\n" + . "$prog: : No such file or directory\n"}], # one file name, no NUL ['1', '--files0-from=-', '<', @@ -95,13 +96,12 @@ my @Tests = ['zero-len', '--files0-from=-', '<', {IN=>{f=>"\0g\0"}}, {AUX=>{g=>''}}, {OUT=>"0 0 0 g\n0 0 0 total\n"}, - {ERR => "$ME: : No such file or directory\n"}, {EXIT=>1} ], + {ERR => "$prog: : No such file or directory\n"}, {EXIT=>1} ], ); my $save_temps = $ENV{DEBUG}; my $verbose = $ENV{VERBOSE}; -my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n"; my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); exit $fail; EOF |