zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk (Zsh hackers list)
Subject: PATCH: omit completion tests if no zpty
Date: Thu, 11 Mar 2004 19:15:58 +0000	[thread overview]
Message-ID: <18997.1079032558@csr.com> (raw)

This should prevent the lack of zpty causing unnecessary grief, although
obviously it doesn't help if zpty is present but not working.

I will try and get 4.2.0-pre-4 out when Oliver has finished off HP-UX
for the time being.  I imagine we will have to do without zpty there.
It would be nice at least to have some way of detecting if it doesn't
work.  (Does it have /dev/ptmx?  Is it defining __SVR4?  If so, it might
be getting into problems fiddling with STREAMS, which is the problem
we had with the first go using /dev/ptmx on Linux.  If that looks
likely, restricting the STREAMS stuff to Solaris is probably the best
bet.  But that's only one of a dozen possibilities.)

I will need to alter MACHINES.  A lot of that material is historical and
should more clearly be indicated as such.  Any pre-edited entries for
particular machine types would come in very handy.


Index: Test/Y01completion.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/Y01completion.ztst,v
retrieving revision 1.3
diff -u -r1.3 Y01completion.ztst
--- Test/Y01completion.ztst	22 Aug 2001 15:59:27 -0000	1.3
+++ Test/Y01completion.ztst	11 Mar 2004 19:01:44 -0000
@@ -1,18 +1,20 @@
 # Tests for completion system.
 
 %prep
-  . $ZTST_srcdir/comptest
-
-  mkdir comp.tmp
-  cd comp.tmp
-
-  comptestinit -z $ZTST_testdir/../Src/zsh &&
-  {
-    mkdir dir1 &&
-    mkdir dir2 &&
-    touch file1 &&
-    touch file2
-  }
+  if ( zmodload -i zsh/zpty ) >/dev/null 2>&1; then
+    . $ZTST_srcdir/comptest
+    mkdir comp.tmp
+    cd comp.tmp
+    comptestinit -z $ZTST_testdir/../Src/zsh &&
+    {
+      mkdir dir1 &&
+      mkdir dir2 &&
+      touch file1 &&
+      touch file2
+    }
+  else
+    ZTST_unimplemented="the zsh/zpty module is not available"
+  fi
 
 %test
 
Index: Test/Y02compmatch.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/Y02compmatch.ztst,v
retrieving revision 1.2
diff -u -r1.2 Y02compmatch.ztst
--- Test/Y02compmatch.ztst	25 Jun 2001 03:06:35 -0000	1.2
+++ Test/Y02compmatch.ztst	11 Mar 2004 19:01:45 -0000
@@ -11,28 +11,30 @@
 # contains the compadd output.
 
 %prep
-  . $ZTST_srcdir/comptest
-
-  mkdir match.tmp
-  cd match.tmp
-
-  comptestinit -z $ZTST_testdir/../Src/zsh &&
-  {
-    list1=(IndianRed IndianRed2 IndianRed3 IndianRed4)
-    test_code () {
-	matcher=$1;
-	list=$2;
-	code="compdef _tst tst ; _tst () { echo -n '<COMPADD>';compadd -M '"
-	code="$code$matcher"
-	code="$code'  - ${(P)list} ; echo  -n '</COMPADD>'"
-        code="$code; $extra_cmd"
-        code="$code; echo -n '<INSERT_POSITIONS>'"
-        code="$code; echo \$compstate[insert_positions]"
-        code="$code; echo -n '</INSERT_POSITIONS>'"
-        code="$code}"
-	comptesteval "$code"
+  if ( zmodload -i zsh/zpty ) >/dev/null 2>&1; then
+    . $ZTST_srcdir/comptest
+    mkdir match.tmp
+    cd match.tmp
+    comptestinit -z $ZTST_testdir/../Src/zsh &&
+    {
+      list1=(IndianRed IndianRed2 IndianRed3 IndianRed4)
+      test_code () {
+    	matcher=$1;
+    	list=$2;
+    	code="compdef _tst tst ; _tst () { echo -n '<COMPADD>';compadd -M '"
+    	code="$code$matcher"
+    	code="$code'  - ${(P)list} ; echo  -n '</COMPADD>'"
+          code="$code; $extra_cmd"
+          code="$code; echo -n '<INSERT_POSITIONS>'"
+          code="$code; echo \$compstate[insert_positions]"
+          code="$code; echo -n '</INSERT_POSITIONS>'"
+          code="$code}"
+    	comptesteval "$code"
+      }
     }
-  }
+  else
+    ZTST_unimplemented="the zsh/zpty module is not available"
+  fi
 
 
 %test
Index: Test/Y03arguments.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/Y03arguments.ztst,v
retrieving revision 1.5
diff -u -r1.5 Y03arguments.ztst
--- Test/Y03arguments.ztst	25 Feb 2002 09:16:27 -0000	1.5
+++ Test/Y03arguments.ztst	11 Mar 2004 19:01:45 -0000
@@ -1,16 +1,18 @@
 # Tests for _arguments.
 
 %prep
-  . $ZTST_srcdir/comptest
-
-  mkdir comp.tmp
-  cd comp.tmp
-
-  comptestinit -z $ZTST_testdir/../Src/zsh &&
-  {
-    comptesteval 'compdef _tst tst'
-    tst_arguments () { comptesteval "_tst () { _arguments ${${(@qq)*}} }" }
-  }
+  if ( zmodload -i zsh/zpty ) >/dev/null 2>&1; then
+    . $ZTST_srcdir/comptest
+    mkdir comp.tmp
+    cd comp.tmp
+    comptestinit -z $ZTST_testdir/../Src/zsh &&
+    {
+      comptesteval 'compdef _tst tst'
+      tst_arguments () { comptesteval "_tst () { _arguments ${${(@qq)*}} }" }
+    }
+  else
+    ZTST_unimplemented="the zsh/zpty module is not available"
+  fi
 
 %test
  tst_arguments ':desc1:(arg1)'

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


             reply	other threads:[~2004-03-11 19:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-11 19:15 Peter Stephenson [this message]
2004-03-12 16:17 ` Oliver Kiddle
2004-03-12 16:56   ` Peter Stephenson
2004-03-12 19:00     ` Oliver Kiddle
2004-03-15 10:43       ` 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=18997.1079032558@csr.com \
    --to=pws@csr.com \
    --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).