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

tests: new function: require_openat_support_

* tests/rm/inaccessible: Factor out openat-support-detection code...
* tests/test-lib.sh (require_openat_support_): ...into this new function.
This commit is contained in:
Jim Meyering
2009-07-29 14:59:27 +02:00
parent 28e3946ef0
commit c06547cade
2 changed files with 16 additions and 7 deletions

View File

@@ -26,13 +26,7 @@ fi
# Skip this test if your system has neither the openat-style functions
# nor /proc/self/fd support with which to emulate them.
skip=yes
grep '^#define HAVE_OPENAT' $CONFIG_HEADER > /dev/null && skip=no
test -d /proc/self/fd && skip=no
if test $skip = yes; then
skip_test_ 'this system lacks openat support'
fi
require_openat_support_
skip_if_root_
p=`pwd`

View File

@@ -47,6 +47,21 @@ require_acl_()
|| skip_test_ "This test requires a local user named bin."
}
require_openat_support_()
{
# Skip this test if your system has neither the openat-style functions
# nor /proc/self/fd support with which to emulate them.
test -z "$CONFIG_HEADER" \
&& skip_test_ 'internal error: CONFIG_HEADER not defined'
_skip=yes
grep '^#define HAVE_OPENAT' "$CONFIG_HEADER" > /dev/null && _skip=no
test -d /proc/self/fd && _skip=no
if test $_skip = yes; then
skip_test_ 'this system lacks openat support'
fi
}
require_ulimit_()
{
ulimit_works=yes