summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Test/C02cond.ztst22
2 files changed, 20 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 95685b9af..c4ec2b2d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-05-28  Bart Schaefer  <schaefer@zsh.org>
+
+	* Andrej: 14501 (as tweaked by 14510): Fix device and FIFO tests
+	for Cygwin and other platforms where they're not implemented or
+	the testing user has insufficient permissions.
+
 2001-05-28  Clint Adams  <clint@zsh.org>
 
 	* 14509: Completion/Base/Core/_setup, Doc/Zsh/compsys.yo,
diff --git a/Test/C02cond.ztst b/Test/C02cond.ztst
index aabbbf23a..28305795f 100644
--- a/Test/C02cond.ztst
+++ b/Test/C02cond.ztst
@@ -27,7 +27,7 @@
 0:-a cond
 
   # Find a block special file system.  This is a little tricky.
-  block=$(find /dev(|ices)/ -type b -print 2> /dev/null)
+  block=$(find /dev(|ices)/ -type b -print)
   if [[ -n $block ]]; then
     [[ -b $block[(f)1] && ! -b zerolength ]]
   else
@@ -36,8 +36,9 @@
   fi
 0D:-b cond
 
-  char=(/dev/tty*([1]))
-  [[ -c $char && ! -c $block ]]
+  # Use hardcoded /dev/tty because globbing inside /dev fails on Cygwin
+  char=/dev/tty
+  [[ -c $char && ! -c $zerolength ]]
 0:-c cond
 
   [[ -d . && ! -d zerolength ]]
@@ -67,13 +68,18 @@
   [[ -o rcs && ! -o norcs && -o noerrexit && ! -o errexit ]]
 0:-o cond
 
-  if whence mkfifo >/dev/null; then
-    mkfifo pipe
+  if ! grep '#define HAVE_FIFOS' $ZTST_testdir/../config.h; then
+    print -u8 'Warning: Not testing [[ -p pipe ]] (FIFOs not supported)'
+    [[ ! -p zerolength ]]
   else
-    mknod pipe p
+    if whence mkfifo && mkfifo pipe || mknod pipe p; then
+      [[ -p pipe && ! -p zerolength ]]
+    else
+      print -u8 'Warning: Not testing [[ -p pipe ]] (cannot create FIFO)'
+      [[ ! -p zerolength ]]
+    fi
   fi
-  [[ -p pipe && ! -p zerolength ]]
-0:-p cond
+0dD:-p cond
 
   [[ -r zerolength && ! -r unmodish ]]
 0:-r cond