From: Martin Quinson Date: Sun, 29 Oct 2023 13:41:10 +0000 (+0100) Subject: tesh: report when the command got signaled in addition to output mismatch X-Git-Tag: v3.35~89^2~40 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/732fa298b5797e83b27340837332cce4384d157a?hp=2beb5fee243831cb738d2a489b37d60f615e3399 tesh: report when the command got signaled in addition to output mismatch --- diff --git a/tools/tesh/catch-timeout-output.tesh b/tools/tesh/catch-timeout-output.tesh index 227d93c77a..e308580806 100644 --- a/tools/tesh/catch-timeout-output.tesh +++ b/tools/tesh/catch-timeout-output.tesh @@ -14,6 +14,7 @@ > @@ -0,0 +1 @@ > +I crashed > Test suite `(stdin)': NOK (<(stdin):2> output mismatch) +> In addition, <(stdin):2> got signal SIGTERM. $ ${bindir:=.}/tesh diff --git a/tools/tesh/tesh.py b/tools/tesh/tesh.py index 2baa1b31df..bec45335a4 100755 --- a/tools/tesh/tesh.py +++ b/tools/tesh/tesh.py @@ -461,6 +461,16 @@ class Cmd: logs.append("Test suite `{file}': NOK (<{cmd}> output mismatch)".format( file=FileReader().filename, cmd=cmd_name)) + + # Also report any failed return code and/or signal we got in case of output mismatch + if not proc.returncode in self.expect_return: + if proc.returncode >= 0: + logs.append("In addition, <{cmd}> returned code {code}.".format( + cmd=cmd_name, code=proc.returncode)) + else: + logs.append("In addition, <{cmd}> got signal {sig}.".format(cmd=cmd_name, + sig=SIGNALS_TO_NAMES_DICT[-proc.returncode])) + if lock is not None: lock.release() if TeshState().keep: