Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
tesh: report when the command got signaled in addition to output mismatch
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 29 Oct 2023 13:41:10 +0000 (14:41 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 29 Oct 2023 13:41:10 +0000 (14:41 +0100)
tools/tesh/catch-timeout-output.tesh
tools/tesh/tesh.py

index 227d93c..e308580 100644 (file)
@@ -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
 
 
index 2baa1b3..bec4533 100755 (executable)
@@ -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: