zsh-workers
 help / color / Atom feed
* [PATCH] test harness: Make the XPass message distinct from the Fail message.
@ 2020-06-23 12:32 Daniel Shahaf
  0 siblings, 0 replies; only message in thread
From: Daniel Shahaf @ 2020-06-23 12:32 UTC (permalink / raw)
  To: zsh-workers

The new output is:

    ./Test/B02typeset.ztst: starting.
    Test ./Test/B02typeset.ztst was expected to fail, but passed.
    Was testing: this is the description that's after the colon on in the ztst file
    ./Test/B02typeset.ztst: test XPassed.
    **************************************
    0 successful test scripts, 1 failure, 0 skipped
    **************************************
    make[1]: *** [Makefile:190: check] Error 1
    make: *** [Makefile:263: check] Error 2

The new function is deliberately very similar to ZTST_testfailed() just
above it.
---
 Test/ztst.zsh | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/Test/ztst.zsh b/Test/ztst.zsh
index 375efd16c..e668ae942 100755
--- a/Test/ztst.zsh
+++ b/Test/ztst.zsh
@@ -146,6 +146,19 @@ $ZTST_failmsg"
   ZTST_testfailed=1
   return 1
 }
+ZTST_testxpassed() {
+  print -r "Test $ZTST_testname was expected to fail, but passed."
+  if [[ -n $ZTST_message ]]; then
+    print -r "Was testing: $ZTST_message"
+  fi
+  print -r "$ZTST_testname: test XPassed."
+  if [[ -n $ZTST_failmsg ]]; then
+    print -r "The following may (or may not) help identifying the cause:
+$ZTST_failmsg"
+  fi
+  ZTST_testfailed=1
+  return 1
+}
 
 # Print messages if $ZTST_verbose is non-empty
 ZTST_verbose() {
@@ -520,7 +533,7 @@ $ZTST_code"
 	return 1
       fi
       if (( expected_to_fail )); then
-        ZTST_testfailed "test was expected to fail, but passed."
+        ZTST_testxpassed
         return 1
       fi
     fi

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-23 12:32 [PATCH] test harness: Make the XPass message distinct from the Fail message Daniel Shahaf

zsh-workers

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git