tests: skip a root-only test when configured without libcap
authorJim Meyering <meyering@redhat.com>
Thu, 2 Oct 2008 13:54:36 +0000 (15:54 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 2 Oct 2008 13:54:36 +0000 (15:54 +0200)
* tests/ls/capability: Test for HAVE_CAP definition in config.h.

tests/ls/capability

index f064348..6336ca1 100755 (executable)
@@ -24,6 +24,9 @@ fi
 . $srcdir/test-lib.sh
 require_root_
 
+grep '^#define HAVE_CAP 1$' $CONFIG_HEADER > /dev/null \
+  || skip_test_ "configured without libcap support"
+
 (setcap --help) 2>&1 |grep 'usage: setcap' > /dev/null \
   || skip_test_ "setcap utility not found"
 fail=0