1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-03 10:21:46 +02:00

46102: test harness: Make the XPass message distinct from the Fail message.

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.
This commit is contained in:
Daniel Shahaf 2020-06-23 12:32:44 +00:00
parent af1c009c3e
commit 304ce85a2a
2 changed files with 19 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2020-06-25 Daniel Shahaf <d.s@daniel.shahaf.name>
* 46102: Test/ztst.zsh: test harness: Make the XPass message
distinct from the Fail message.
2020-06-22 Peter Stephenson <p.stephenson@samsung.com>
* 46079: Src/math.c, Test/C01arith.ztst: Ignore double quotes in

View file

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