* 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.
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
. $srcdir/../lang-default
. $srcdir/../test-lib.sh
+require_built_ groups id
fail=0
groups --version | sed 's/^groups/id/; /^$/q' > out || fail=1
&& 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.