zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>,
	"ZSH Workers Mailing List" <zsh-workers@sunsite.dk>
Subject: Re: PATCH: Block device tests
Date: Mon, 28 May 2001 16:06:38 +0000	[thread overview]
Message-ID: <1010528160638.ZM5969@candle.brasslantern.com> (raw)
In-Reply-To: <000701c0e742$6f9f1bd0$21c9ca95@mow.siemens.ru>

On May 28, 10:50am, Andrej Borsenkow wrote:
} Subject: Re: PATCH: Block device tests
}
} > Could we use a grep of config.h as the not-implemented test?
} 
} Yes; this does it for mkfifo test. For procsubst we need to skip the whole
} file (not just a single test) - I cannot see how to do it currently (the
} grep shuold be for HAVE_FIFOS or HAVE_PATH_FD).

Hmm.  Are there other platforms that don't HAVE_PATH_FD where process
substitution does work?

} +  if ! grep '#define HAVE_FIFOS' ../../config.h > /dev/null 2>&1; then
} +    print -u8 'Warning: Not testing [[ -p pipe ]] (FIFOs not supported)'
} +    [[ ! -p zerolength ]]
}    else
} +    if whence mkfifo >/dev/null; then
} +      mkfifo pipe
} +    else
} +      mknod pipe p
} +    fi
} +    [[ ( $nopipe == true || -p pipe ) && ! -p zerolength ]]
}    fi
}  0:-p cond

That $nopipe looks like it drifted in from another patch.  Also, I've
begun to prefer using `0d' and `0D' and even (in this case) `0dD' as
the result key rather than redirecting the output of the "setup" code,
because then with ZTST_verbose=2 one actually gets to see the results
of the find/grep/whence/etc., which can be helpful in debugging.

Perhaps printing the stdout/stderr should move up to ZTST_verbose == 3.

Anyway, I'm going to commit the following and credit Andrej.

diff -u zsh-forge/current/Test/C02cond.ztst zsh-4.0/Test/C02cond.ztst
--- zsh-forge/current/Test/C02cond.ztst	Sun May 27 15:43:53 2001
+++ zsh-4.0/Test/C02cond.ztst	Mon May 28 08:57:22 2001
@@ -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

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


  reply	other threads:[~2001-05-28 16:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-22 15:14 Almost all tests pass under new cygwin Andrej Borsenkow
2001-05-22 15:24 ` Andrej Borsenkow
2001-05-22 15:31 ` Bart Schaefer
2001-05-22 15:44   ` Oliver Kiddle
2001-05-23 16:51     ` About zmodload test segfaults Bart Schaefer
2001-05-24 12:15       ` Andrej Borsenkow
2001-05-25 16:54         ` PATCH: Block device tests Bart Schaefer
2001-05-26  8:24           ` Andrej Borsenkow
2001-05-27 22:54             ` Bart Schaefer
2001-05-28  6:50               ` Andrej Borsenkow
2001-05-28 16:06                 ` Bart Schaefer [this message]
2001-05-28 17:25                   ` Bart Schaefer
2001-05-29 10:34                   ` Peter Stephenson
2001-05-29 10:51                     ` Andrej Borsenkow
2001-05-29 15:37                       ` Bart Schaefer
2001-05-30  9:21                         ` Peter Stephenson
2001-05-28  9:21       ` About zmodload test segfaults Sven Wischnowsky
2001-05-22 15:53   ` Almost all tests pass under new cygwin Andrej Borsenkow
2001-05-23 11:40 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1010528160638.ZM5969@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=Andrej.Borsenkow@mow.siemens.ru \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).