]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Avoid another "make check" failure due to omitted programs.
authorJim Meyering <meyering@redhat.com>
Thu, 20 Dec 2007 13:19:56 +0000 (14:19 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 20 Dec 2007 13:19:56 +0000 (14:19 +0100)
* tests/test-lib.sh (require_built_): New function.
* tests/misc/groups-version: Use it to skip this test if
either groups or id is not built.

ChangeLog
tests/misc/groups-version
tests/test-lib.sh

index 427f78e50fbfeedc3defe54b6362e653bdd66d26..412f13a0583e250cea84e3648ac09f1cbc631da8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2007-12-20  Jim Meyering  <meyering@redhat.com>
 
+       Avoid another "make check" failure due to omitted programs.
+       * tests/test-lib.sh (require_built_): New function.
+       * tests/misc/groups-version: Use it to skip this test if
+       either groups or id is not built.
+
        Avoid spurious "make check" failures due to omitted programs.
        * man/Makefile.am (distcheck-hook): Make check rules dependents of
        this target, not of check-local, so that people aren't distracted by
index 15327be324fb898185c19ccecac84a189b7a6305..e7050c30f660f8c1c775618a392bff694afec599 100755 (executable)
@@ -23,6 +23,7 @@ fi
 
 . $srcdir/../lang-default
 . $srcdir/../test-lib.sh
+require_built_ groups id
 
 fail=0
 groups --version | sed 's/^groups/id/; /^$/q' > out || fail=1
index 8872b27b174f22ee57478cf7a5f0f4401878a857..a3afba0bf0e6fe4ff7e5486efad5793a248ba473 100644 (file)
@@ -29,6 +29,19 @@ require_ulimit_()
     && skip_test_ "this shell lacks ulimit support"
 }
 
+require_built_()
+{
+  skip_=no
+  for i in "$@"; do
+    case " $built_programs " in
+      *" $i "*) ;;
+      *) echo "$i: not built" 1>&2; skip_=yes ;;
+    esac
+  done
+
+  test $skip_ = yes && skip_test_ "required program(s) not built"
+}
+
 uid_is_privileged_()
 {
   # Make sure id -u succeeds.