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

[PATCH] runtests.zsh: output name of crashed test script



If a test script (for example D04parameter.zsh as in my
previous post) crashes, runtests.zsh writes:
"xx successful test scripts, 1 failure, yy skipped"

But it takes some time to see which test has failed,
because ztst.zsh dies before writing
"./D04parameter.ztst: failed".

We need to look through all the output and find that
there is a line
"D04parameter.ztst: starting."
but no line
"D04parameter.ztst: failed (or all tests successful)."

# Yes, the directory Test/parameter.tmp is not removed
# and we can guess from this, but ...

With the patch below runtest.zsh writes the name of
crashed script(s) with the signal name.


diff --git a/Test/runtests.zsh b/Test/runtests.zsh
index b66d579b6..538663f50 100644
--- a/Test/runtests.zsh
+++ b/Test/runtests.zsh
@@ -15,6 +15,7 @@ for file in "${(f)ZTST_testlist}"; do
     (( skipped++ ))
   elif (( $retval )); then
     (( failure++ ))
+    (( $retval > 128 )) && print "$file: failed: SIG$signals[$retval - 127]."
   else
     (( success++ ))
   fi







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