1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-20 18:56:39 +02:00

Enable some previously omitted test scripts. Add a test cross-check.

* tests/rm/Makefile.am (TESTS): Add empty-name and unreadable.
* tests/rm/empty-name: Likewise.
* tests/rm/unreadable: Reenable this test.  Adjust for new rm.
* tests/mkdir/Makefile.am: Add writable-under-readonly.
* tests/mkdir/writable-under-readonly: Add some comments.
This test is always skipped, for now.
* tests/Makefile.am (ta): Hook up the new root-only script.
* tests/tail-2/infloop-1: Make this test pass.
* tests/tail-2/Makefile.am (TESTS): Add infloop-1.
* tests/tail-2/fflush: Remove unused file.
* tests/check.mk (vc_executable_is_in_TESTS): More portable.
* tests/check.mk (check): Depend on the above.
* build-aux/check.mk: Remove comment mentioning AUTHORS file.
This commit is contained in:
Jim Meyering
2007-09-13 12:13:35 +02:00
parent 56f1bd10fc
commit d96a863cf5
15 changed files with 89 additions and 77 deletions

View File

@@ -8,8 +8,6 @@
##
## The complete GNU General Public Licence Notice can be found as the
## `COPYING' file in the root directory.
##
## The Vaucanson Group consists of people listed in the `AUTHORS' file.
## Override the definition from Automake to generate a log file with
## failed tests. It also supports parallel make checks.

View File

@@ -50,7 +50,7 @@ SUBDIRS = \
uniq wc
## N O T E :: Please do not add new directories.
all_t = t1 t2 t3 t4 t5 t6 t7 t8 t9
all_t = t1 t2 t3 t4 t5 t6 t7 t8 t9 ta
.PHONY: check-root $(all_t)
check-root: $(all_t)
@@ -72,6 +72,8 @@ t8:
cd misc && $(MAKE) check TESTS=chcon
t9:
cd cp && $(MAKE) check TESTS=cp-a-selinux
ta:
cd mkdir && $(MAKE) check TESTS=writable-under-readonly
check-recursive: root-hint

View File

@@ -1,14 +1,30 @@
# FIXME: add comment
# Include this file at the end of each tests/*/Makefile.am.
# Copyright (C) 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/>.
# Ensure that all version-controlled executable files are listed in TESTS.
_v = TESTS
FIXME_hook_this_to_make_distcheck:
sed -n '/^$(_v) =/,/[^\]$$/p' $(srcdir)/Makefile.am \
| sed 's/^ *//;/^\$$.*/d;/^$(_v) =/d' \
| tr -s '\012\\' ' ' | fmt -1 | sort -u > t1
find `$(top_srcdir)/build-aux/vc-list-files $(srcdir)` \
-type f -perm -111 -printf '%f\n'|sort -u \
| diff -u t1 -
vc_exe_in_TESTS: Makefile
@if test -d $(top_srcdir)/.git; then \
echo $(TESTS) | tr -s ' ' '\n' | sort -u > t1; \
for f in `$(top_srcdir)/build-aux/vc-list-files .`; do \
test -f "$$f" && test -x "$$f" && echo "$$f"; \
done | sort -u | diff -u t1 -; \
else :; fi
check: vc_exe_in_TESTS
.PHONY: vc_exe_in_TESTS
# Append this, because automake does the same.
TESTS_ENVIRONMENT += \
@@ -20,5 +36,5 @@ TESTS_ENVIRONMENT += \
TEST_LOGS = $(TESTS:=.log)
# Parallel replacement of Automake's check-TESTS target.
# Include it last.
# CAVEAT: code in the following relies on GNU make.
include $(top_srcdir)/build-aux/check.mk

View File

@@ -8,6 +8,7 @@ TESTS_ENVIRONMENT = \
PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH" \
PROG=dd
TESTS = misc not-rewound skip-seek skip-seek2 unblock-sync
TESTS = \
misc not-rewound skip-seek skip-seek2 unblock-sync
include $(top_srcdir)/tests/check.mk

View File

@@ -1,5 +1,10 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
TESTS = trap basic-1 create-leading d-slashdot
TESTS = \
basic-1 \
create-leading \
d-slashdot \
trap
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = \
EXEEXT='$(EXEEXT)' \

View File

@@ -1,5 +1,7 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
TESTS = hard-backup target-1 sf-1 misc backup-1
TESTS = \
hard-backup target-1 sf-1 misc backup-1
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = \
CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \

View File

@@ -1,7 +1,17 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
TESTS = \
p-1 \
p-2 \
p-3 \
p-slashdot \
p-thru-slink \
p-3 p-1 p-2 p-v special-1 perm parents t-slash p-slashdot
p-v \
parents \
perm \
special-1 \
t-slash \
writable-under-readonly
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = \
CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \

View File

@@ -1,8 +1,7 @@
#!/bin/sh
# This is just for the record.
# This test is not run.
# FIXME: convert this to a root-only test.
# 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
@@ -25,20 +24,31 @@
#
# Demonstrate the problem, as root:
mount='sudo mount'
if test "$VERBOSE" = yes; then
set -x
mkdir --version
fi
PRIV_CHECK_ARG=require-root . $srcdir/../priv-check
. $srcdir/../test-lib.sh
# FIXME: for now, skip it unconditionally
skip_test_ temporarily disabled
# FIXME: define cleanup_ to do the umount
# FIXME: use mktemp
cd /tmp \
&& dd if=/dev/zero of=1 bs=8192 count=50 \
&& dd if=/dev/zero of=2 bs=8192 count=50 \
&& mkdir -p mnt-ro && mkfs -t ext2 1 && mkfs -t ext2 2 \
&& $mount -o loop=/dev/loop3 1 mnt-ro \
&& mount -o loop=/dev/loop3 1 mnt-ro \
&& mkdir -p mnt-ro/rw \
&& $mount -o remount,ro mnt-ro \
&& $mount -o loop=/dev/loop4 2 mnt-ro/rw
&& mount -o remount,ro mnt-ro \
&& mount -o loop=/dev/loop4 2 mnt-ro/rw
mkdir -p mnt-ro/rw/sub || fail=1
# To clean up
umount /tmp/2
umount /tmp/1
rm -rf /tmp/[12]

View File

@@ -1,5 +1,7 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
TESTS = rl-1 can-e can-f can-m
TESTS = \
rl-1 can-e can-f can-m
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = \
CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \

View File

@@ -33,12 +33,15 @@ TESTS = \
unread3 \
no-give-up \
dir-no-w \
empty-name \
fail-2eperm \
cycle i-no-r fail-eperm \
rm1 rm2 rm3 rm4 rm5 \
unread2 r-1 r-2 r-3 r-4 i-1 ir-1 f-1 sunos-1 \
unreadable \
interactive-always interactive-once \
isatty # unreadable empty-name
isatty
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = \
RM=../../src/rm \

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# Test "rm" and unreadable directories.
# Copyright (C) 1998, 2003, 2005, 2006 Free Software Foundation, Inc.
# Copyright (C) 1998, 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
@@ -43,12 +43,12 @@ my @Tests =
(
# test-name options input expected-output
#
['unreadable-1', '-rf', $d,
{EXIT => 1}, {ERR => "$prog: $d/.: Permission denied\n"}, $mkdir],
# Removing an empty, unwritable directory succeeds.
['unreadable-1', '-rf', $d, {EXIT => 0}, $mkdir],
['unreadable-2', '-rf', $d,
{EXIT => 1},
{ERR => "$prog: $d/.: Permission denied\n" .
"$prog: cannot remove directory `$d': File exists\n"},
{ERR => "$prog: cannot remove \`$d': Permission denied\n"},
{PRE => sub { (mkdir $d,0700 and mkdir "$d/x",0700 and chmod 0100,$d)
or die "$d: $!\n"}} ],
);

View File

@@ -1,5 +1,6 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
TESTS = fail-perm ignore t-slash
TESTS = \
fail-perm ignore t-slash
EXTRA_DIST = $(TESTS)
TESTS_ENVIRONMENT = \

View File

@@ -27,6 +27,7 @@ TESTS_ENVIRONMENT = \
TESTS = \
append-only \
tail-n0f \
infloop-1 \
big-4gb proc-ksyms start-middle assert assert-2
include $(top_srcdir)/tests/check.mk

View File

@@ -1,43 +0,0 @@
#!/bin/sh
# This test would fail on solaris5.7 with tail from pre-1.22k textutils.
# The problem was that using the solaris5.7 setvbuf function to turn off
# buffering doesn't flush stdout.
# Copyright (C) 1999, 2000, 2003, 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/>.
# FIXME: actually, I couldn't find a way to write the test (without resorting
# to use of expect) so that it would provoke the failure on solaris5.7.
# To exercise the bug, cat's stdout seems to have to be directed
# to a terminal.
if test "$VERBOSE" = yes; then
set -x
tail --version
fi
. $srcdir/../test-lib.sh
echo fubar > in
tail -f in | cat > out &
pid=$!
sleep 1
kill $pid
fail=0
test "`cat out`" = fubar || fail=1
exit $fail

View File

@@ -32,4 +32,8 @@ tail -n 1 t &
tail_pid=$!
kill $yes_pid
sleep 1
kill $tail_pid
fail=0
kill $tail_pid && fail=1 || :
(exit $fail); exit $fail