diff options
author | Jim Meyering <meyering@redhat.com> | 2009-07-29 14:59:27 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2009-07-30 17:47:21 +0200 |
commit | c06547cadeed50e85b1de661634a39f7321e562c (patch) | |
tree | 4a52d4c001998c7c04908422a9f25813f864ddd9 /tests/test-lib.sh | |
parent | 28e3946ef05bbf92bfce400f3f03f9abb312d63a (diff) | |
download | coreutils-c06547cadeed50e85b1de661634a39f7321e562c.tar.xz |
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.
Diffstat (limited to 'tests/test-lib.sh')
-rw-r--r-- | tests/test-lib.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test-lib.sh b/tests/test-lib.sh index 9797b552e..1174d980b 100644 --- a/tests/test-lib.sh +++ b/tests/test-lib.sh @@ -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 |