From: Alexandre Duret-Lutz Date: Mon, 19 Aug 2002 13:09:00 +0000 (+0000) Subject: Fix for PR automake/345: X-Git-Tag: Release-1-6d~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15c2697c5f85d7a70f0460ddd8a8b0080b6fd4b5;p=thirdparty%2Fautomake.git Fix for PR automake/345: * tests/defs: Add support for required=non-root, stolen from fileutils' test suite. * tests/destdir.test: Use required=non-root. --- diff --git a/ChangeLog b/ChangeLog index e378f68f5..08e8e9feb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2002-08-19 Alexandre Duret-Lutz + Fix for PR automake/345: + * tests/defs: Add support for required=non-root, stolen + from fileutils' test suite. + * tests/destdir.test: Use required=non-root. + * tests/vtexi.test: Fix spurious failure introduced on 2002-07-30. 2002-08-17 Tom Tromey diff --git a/tests/defs b/tests/defs index 631504099..42ecd490b 100644 --- a/tests/defs +++ b/tests/defs @@ -56,6 +56,17 @@ then echo "$me: running $CXX --version" ( $CXX --version ) || exit 77 ;; + non-root) + # Skip this test case if the user is root. + # We try to append to a read-only file to detect this. + priv_check_temp=priv-check.$$ + touch $priv_check_temp || exit 1 + chmod a-w $priv_check_temp || exit 1 + (echo foo >> $priv_check_temp) >/dev/null 2>&1 + overwrite_status=$? + rm -f $priv_check_temp + test $overwrite_status = 0 && exit 77 + ;; # Generic case: the tool must support --version. *) echo "$me: running $tool --version" diff --git a/tests/destdir.test b/tests/destdir.test index 8a4fd8c4c..cccbd8368 100755 --- a/tests/destdir.test +++ b/tests/destdir.test @@ -3,6 +3,10 @@ # Make sure that `make distcheck' can find some $(DESTDIR) omissions. # PR/186. +# The feature we test here relies on read-only files. +# It will only work for non-root users. +required='non-root' + . $srcdir/defs || exit 1 set -e