tesh: command stdout/stderr lost on timeout
It seems that tesh drops command's stdout/stderr when timeout is reached.
This is not helpful to determine why the timeout has been reached, logs can help here.
Tested with the tesh bundled with SimGrid-3.22.2.
Tesh input file
! timeout 5
$ sh -c 'echo "All went fine." && sleep 2'
> All went fine.
! timeout 1
$ sh -c 'echo "Oops, I crashed." && sleep 2'
> All went fine.
Current output
Test suite '/tmp/mwe.tesh'
[mwe.tesh:2] sh -c 'echo "All went fine." && sleep 2'
[mwe.tesh:6] sh -c 'echo "Oops, I crashed." && sleep 2'
Test suite `mwe.tesh': NOK (<mwe.tesh:6> timeout after 1 sec)
Expected output
Still match obtained output against the expected one. Something like:
Test suite '/tmp/mwe.tesh'
[mwe.tesh:2] sh -c 'echo "Oops, I crashed. Reason: MWE." && sleep 2'
[mwe.tesh:6] sh -c 'echo "Oops, I crashed. Reason: MWE." && sleep 2'
Output of <mwe.tesh:6> mismatch:
--- expected
+++ obtained
@@ -1 +1 @@
-All went fine.
+Oops, I crashed.
Test suite `mwe.tesh': NOK (<mwe.tesh:6> timeout after 1 sec and output mismatch)