5 # Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 $PERL -e 1 > /dev/null 2>&1 || {
24 echo 1>&2 "$0: configure didn't find a usable version of Perl," \
25 "so can't run this test"
29 # Ensure that we don't run an older version of fold.
30 # Prior to 5.0.91, some of the tests below would cause fold to infloop,
31 # and since `make check' might be run even after a build failure, it'd
32 # expose just such an older version.
33 ver=`fold --version|sed 1q`
35 *" $PACKAGE_VERSION") ;;
37 "$0: found unexpected version of fold, \`$ver'"
38 "(expected $PACKAGE_VERSION)"
42 me=`echo $0|sed 's,.*/,,'`
43 exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
48 (my $program_name = $0) =~ s|.*/||;
50 # Turn off localization of executable's ouput.
51 @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
55 ['s1', '-w2 -s', {IN=>"a\t"}, {OUT=>"a\n\t"}],
56 ['s2', '-w4 -s', {IN=>"abcdef d\n"}, {OUT=>"abcd\nef d\n"}],
57 ['s3', '-w4 -s', {IN=>"a cd fgh\n"}, {OUT=>"a \ncd \nfgh\n"}],
58 ['s4', '-w4 -s', {IN=>"abc ef\n"}, {OUT=>"abc \nef\n"}],
61 my $save_temps = $ENV{DEBUG};
62 my $verbose = $ENV{VERBOSE};
64 my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
65 my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);