mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-03-09 06:24:24 +02:00
* build-aux/check.mk: New file, from The Vaucanson Group. * .x-sc_GPL_version: New file, to allow "version 2 or later" in build-aux/check.mk. * Makefile.am (EXTRA_DIST): Add .x-sc_GPL_version. * tests/check.mk: New file. * tests/Makefile.am (EXTRA_DIST): Add check.mk, mkdtemp and test-lib.sh. Begin factoring "sample-test" out of test scripts. * tests/test-lib.sh: New file, to be sourced by all tests that were previously derived from the "sample-test" template. * tests/mkdtemp: New file. * tests/touch/dir-1: Use test-lib.sh. * tests/touch/empty-file: Likewise. * tests/touch/fail-diag: Likewise. * tests/touch/fifo: Likewise. * tests/touch/no-create-missing: Likewise. * tests/touch/no-rights: Likewise. Also, don't sleep. * tests/touch/not-owner: Likewise. * tests/touch/obsolescent: Likewise. * tests/touch/read-only: Likewise. * tests/touch/relative: Likewise. * tests/touch/Makefile.am: Include $(top_srcdir)/tests/check.mk, to get the parallel-"make check" bits. Move a slow test into tests/misc. * tests/check.mk: Wrapper. * tests/ls/time-1: Move this file to tests/misc/ls-time. * tests/misc/ls-time: New file. From tests/ls/time-1. * tests/ls/Makefile.am (TESTS): Remove time-1. * tests/misc/Makefile.am (TESTS): Add ls-time.
64 lines
1.9 KiB
Perl
Executable File
64 lines
1.9 KiB
Perl
Executable File
#!/bin/sh
|
|
# Test "cut". -*- perl -*-
|
|
|
|
# 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
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
: ${PERL=perl}
|
|
: ${srcdir=.}
|
|
|
|
$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"
|
|
exit 77
|
|
}
|
|
|
|
me=`echo $0|sed 's,.*/,,'`
|
|
exec $PERL -w -I$srcdir/.. -MCoreutils -M"CuTmpdir qw($me)" -- - <<\EOF
|
|
require 5.003;
|
|
use strict;
|
|
|
|
(my $ME = $0) =~ s|.*/||;
|
|
|
|
# Turn off localisation of executable's ouput.
|
|
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
|
|
|
|
my $prog = 'cut';
|
|
my $diag = <<DIAG_EOF;
|
|
$prog: fields and positions are numbered from 1
|
|
Try \`cut --help' for more information.
|
|
DIAG_EOF
|
|
|
|
my @Tests =
|
|
(
|
|
# Provoke a double-free in cut from coreutils-6.7.
|
|
['dbl-free', '-f2-', {IN=>{f=>'x'}}, {IN=>{g=>'y'}}, {OUT=>"x\ny\n"}],
|
|
|
|
# This failed (as it should) even before coreutils-6.10,
|
|
# but cut from 6.10 produces a more useful diagnostic.
|
|
['zero-1', '-b0', {ERR=>$diag}, {EXIT => 1} ],
|
|
|
|
# Before coreutils-6.10, specifying a range of 0-2 was not an error.
|
|
# It was treated just like "-2".
|
|
['zero-2', '-f0-2', {ERR=>$diag}, {EXIT => 1} ],
|
|
);
|
|
|
|
my $save_temps = $ENV{DEBUG};
|
|
my $verbose = $ENV{VERBOSE};
|
|
|
|
my $fail = run_tests ($ME, $prog, \@Tests, $save_temps, $verbose);
|
|
exit $fail;
|
|
EOF
|