Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: omit completion tests if no zpty



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@xxxxxxx>                  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
**********************************************************************



Messages sorted by: Reverse Date, Date, Thread, Author