autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Ignore errors from ./run on w32.


From: Eric Blake
Subject: Re: [PATCH] Ignore errors from ./run on w32.
Date: Tue, 4 Mar 2008 21:33:33 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de> writes:

> 
> * tests/autotest.at (whitespace in absolute testdir):
> Ignore stderr for `./run' which fails to remove the
> busy test directory on w32.
> ---
> 
> Applied to master.  This is in line with some other testsuite
> invocations of `./run'.

Another w32 oddity (tested on cygwin, but probably also present on mingw) is 
that with administrator privileges, you can rename and delete files into a read-
only directory, even though you can't directly create one there.  As such, test 
122 was failing for me (config.status is able to unexpectedly create var-file 
in a temp directory, then move it to the read-only `.').  This patch skips the 
test if this root-like ability is present (which in turn probably fixes the 
problems that others reported when running the testsuite as root on a system 
with traditional Unix semantics).

I noticed that I couldn't do:

some_test || AT_CHECK()

since AT_CHECK() expands to "statements;" rather than "{ statements; }".  
Should we make AT_CHECK an inlineable statement group?

From: Eric Blake <address@hidden>
Date: Tue, 4 Mar 2008 14:28:54 -0700
Subject: [PATCH] Ignore tests that require read-only directories under root.

* tests/torture.at (AT_CHECK_CONFIG_CREATION_NOWRITE): Skip
no-write portion if user has root-like privileges.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog        |    6 ++++++
 tests/torture.at |   10 +++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 08cfd73..0b699fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-03-04  Eric Blake  <address@hidden>
+
+       Ignore tests that require read-only directories under root.
+       * tests/torture.at (AT_CHECK_CONFIG_CREATION_NOWRITE): Skip
+       no-write portion if user has root-like privileges.
+
 2008-03-03  Eric Blake  <address@hidden>
 
        Documentation improvements.
diff --git a/tests/torture.at b/tests/torture.at
index 58785ae..d8ae8f3 100644
--- a/tests/torture.at
+++ b/tests/torture.at
@@ -211,9 +211,17 @@ AT_CHECK([grep OK $1], [], [OK
 AT_CHECK_CONFIGURE([what_to_test=var-$1 --no-create])
 # config.status might be stupidly expecting data on stdin, if it's
 # really broken...
+# Skip check if user can rename files into a read-only directory (when
+# run by root or on w32).
+touch t
 chmod a-w .
-AT_CHECK([./config.status var-$1 </dev/null], [1], [ignore], [ignore])
+if mv t t1 >/dev/null 2>&1 ; then
+  :
+else
+  AT_CHECK([./config.status var-$1 </dev/null], [1], [ignore], [ignore])
+fi
 chmod u+w .
+rm -rf t t1
 ])# AT_CHECK_CONFIG_CREATION_NOWRITE
 
 
-- 
1.5.4








reply via email to

[Prev in Thread] Current Thread [Next in Thread]