about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrey Borzenkov <bor@users.sourceforge.net>2001-06-26 15:02:34 +0000
committerAndrey Borzenkov <bor@users.sourceforge.net>2001-06-26 15:02:34 +0000
commitb053d02cdb782f02e85b540b3fc0e2a70faa5695 (patch)
tree692af2d1f6c20cfc2513e83505e7670b52a096de
parent760d3b89a35743f79f825854d5fb4b04d0d261d7 (diff)
downloadzsh-b053d02cdb782f02e85b540b3fc0e2a70faa5695.tar.gz
zsh-b053d02cdb782f02e85b540b3fc0e2a70faa5695.tar.xz
zsh-b053d02cdb782f02e85b540b3fc0e2a70faa5695.zip
15099: rudimental support for skipping unimplemented tests
-rw-r--r--ChangeLog5
-rw-r--r--Test/D03procsubst.ztst14
-rwxr-xr-xTest/ztst.zsh19
3 files changed, 29 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index ad778d1f5..eba0d6392 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-06-26  Andrej Borsenkow  <bor@zsh.org>
+
+	* 15099: Test/D03procsubst.ztst, Test/ztst.zsh: add some support
+	for skipping unimplemented features
+
 2001-06-26  Clint Adams  <clint@zsh.org>
 
 	* 15094: Functions/Prompts/prompt_clint_setup:
diff --git a/Test/D03procsubst.ztst b/Test/D03procsubst.ztst
index 1810f9178..c1d7d289d 100644
--- a/Test/D03procsubst.ztst
+++ b/Test/D03procsubst.ztst
@@ -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)
diff --git a/Test/ztst.zsh b/Test/ztst.zsh
index de37e97e8..414b26c6c 100755
--- a/Test/ztst.zsh
+++ b/Test/ztst.zsh
@@ -232,9 +232,11 @@ ZTST_execchunk() {
 ZTST_prepclean() {
   # Execute indented code chunks.
   while ZTST_getchunk; do
-    ZTST_execchunk >/dev/null || [[ -n $1 ]] ||
-    ZTST_testfailed "non-zero status from preparation code:
-$ZTST_code"
+    ZTST_execchunk >/dev/null || [[ -n $1 ]] || {
+      [[ -n "$ZTST_unimplemented" ]] ||
+      ZTST_testfailed "non-zero status from preparation code:
+$ZTST_code" && return 0
+    }
   done
 }
 
@@ -363,8 +365,11 @@ ZTST_sects=(prep 0 test 0 clean 0)
 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 +404,10 @@ while ZTST_getsect $ZTST_skipok; do
   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 ))