zsh-workers
 help / color / mirror / code / Atom feed
From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru>
To: "ZSH Workers Mailing List" <zsh-workers@sunsite.dk>
Subject: PATCH: "unimplemented" for test suite
Date: Wed, 13 Jun 2001 12:01:30 +0400	[thread overview]
Message-ID: <000b01c0f3df$0df301e0$21c9ca95@mow.siemens.ru> (raw)

[-- Attachment #1: Type: text/plain, Size: 202 bytes --]

This is attempt to skip test suite if some prerequisites are missing. I am
not sure how useful it actually is - when test fails with an error it at
least draws some attention.

Any suggestion?

-andrej

[-- Attachment #2: zsh-test.diff --]
[-- Type: application/octet-stream, Size: 5202 bytes --]

Index: Test/D03procsubst.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/D03procsubst.ztst,v
retrieving revision 1.1
diff -u -r1.1 D03procsubst.ztst
--- Test/D03procsubst.ztst	2001/04/02 12:33:49	1.1
+++ Test/D03procsubst.ztst	2001/06/13 07:57:44
@@ -1,10 +1,16 @@
 # Tests for process substitution: <(...), >(...) and =(...).
 
 %prep
-  mkdir procsubst.tmp
-  cd procsubst.tmp
-  print 'First\tSecond\tThird\tFourth' >FILE1
-  print 'Erste\tZweite\tDritte\tVierte' >FILE2
+  if grep '#define PATH_DEV_FD' $ZTST_testdir/../config.h > /dev/null 2>&1 ||
+     grep '#define HAVE_FIFOS' $ZTST_testdir/../config.h > /dev/null 2>&1; then
+    mkdir procsubst.tmp
+    cd procsubst.tmp
+    print 'First\tSecond\tThird\tFourth' >FILE1
+    print 'Erste\tZweite\tDritte\tVierte' >FILE2
+  else
+    ZTST_unimplemented="process substitution is not supported"
+    true
+  fi
 
 %test
   paste <(cut -f1 FILE1) <(cut -f3 FILE2)
Index: Test/Y01completion.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/Y01completion.ztst,v
retrieving revision 1.1
diff -u -r1.1 Y01completion.ztst
--- Test/Y01completion.ztst	2001/04/02 12:35:14	1.1
+++ Test/Y01completion.ztst	2001/06/13 07:57:44
@@ -7,11 +7,15 @@
   cd comp.tmp
 
   comptestinit -z $ZTST_testdir/../Src/zsh
-
-  mkdir dir1
-  mkdir dir2
-  touch file1
-  touch file2
+  if zmodload -e zsh/zpty ; then
+    mkdir dir1
+    mkdir dir2
+    touch file1
+    touch file2
+  else
+    ZTST_unimplemented="could not load zsh/zpty"
+    true
+  fi
 
 %test
 
Index: Test/Y02compmatch.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/Y02compmatch.ztst,v
retrieving revision 1.1
diff -u -r1.1 Y02compmatch.ztst
--- Test/Y02compmatch.ztst	2001/04/02 12:35:31	1.1
+++ Test/Y02compmatch.ztst	2001/06/13 07:57:45
@@ -17,21 +17,25 @@
   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 -e zsh/zpty ; then
+    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="could not load zsh/zpty"
+    true
+  fi
 
 
 
Index: Test/Y03arguments.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/Y03arguments.ztst,v
retrieving revision 1.1
diff -u -r1.1 Y03arguments.ztst
--- Test/Y03arguments.ztst	2001/04/02 12:35:48	1.1
+++ Test/Y03arguments.ztst	2001/06/13 07:57:45
@@ -7,9 +7,13 @@
   cd comp.tmp
 
   comptestinit -z $ZTST_testdir/../Src/zsh
-  comptesteval 'compdef _tst tst'
-  tst_arguments () { comptesteval "_tst () { _arguments ${${(@qq)*}} }" }
-
+  if zmodload -e zsh/zpty ; then
+    comptesteval 'compdef _tst tst'
+    tst_arguments () { comptesteval "_tst () { _arguments ${${(@qq)*}} }" }
+  else
+    ZTST_unimplemented="could not load zsh/zpty"
+    true
+  fi
 %test
  tst_arguments ':desc1:(arg1)'
  comptest $'tst \t\C-wa\t\C-war\t\C-warg\t\C-warg1\t\C-wr\t\C-wx\t \ty \t'
Index: Test/ztst.zsh
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/ztst.zsh,v
retrieving revision 1.15
diff -u -r1.15 ztst.zsh
--- Test/ztst.zsh	2001/05/22 09:27:25	1.15
+++ Test/ztst.zsh	2001/06/13 07:57:45
@@ -363,8 +363,11 @@
 print "$ZTST_testname: starting."
 
 # Now go through all the different sections until the end.
+# prep section may set ZTST_unimplemented, in this case the actual
+# tests will be skipped
 ZTST_skipok=
-while ZTST_getsect $ZTST_skipok; do
+ZTST_unimplemented=
+while [[ -z "$ZTST_unimplemented" ]] && ZTST_getsect $ZTST_skipok; do
   case $ZTST_cursect in
     prep) if (( ${ZTST_sects[prep]} + ${ZTST_sects[test]} + \
 	        ${ZTST_sects[clean]} )); then
@@ -399,6 +402,10 @@
   esac
 done
 
-(( $ZTST_testfailed )) || print "$ZTST_testname: all tests successful."
+if [[ -n "$ZTST_unimplemented" ]]; then
+  print "$ZTST_testname: skipped ($ZTST_unimplemented)"
+elif (( ! $ZTST_testfailed )); then
+  print "$ZTST_testname: all tests successful."
+fi
 ZTST_cleanup
 exit $(( ZTST_testfailed ))

             reply	other threads:[~2001-06-13  8:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-13  8:01 Andrej Borsenkow [this message]
2001-06-18 18:04 ` Bart Schaefer
2001-06-18 18:44   ` Andrej Borsenkow
2001-06-18 19:02     ` Bart Schaefer
2001-06-18 19:09       ` Bart Schaefer
2001-06-26 14:52       ` Andrej Borsenkow

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='000b01c0f3df$0df301e0$21c9ca95@mow.siemens.ru' \
    --to=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).