tests/run.sh: Print special message for timeout

The timeout utility guarantees an exit code of 124 when the process died due to
timeout. Since awesome only ever exits with 0 or 1, we can use this to reliably
detect timeouts and print a matching message.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-09-25 06:00:15 +02:00
parent 60ee10cfff
commit a430ac1e23
1 changed files with 5 additions and 1 deletions

View File

@ -217,7 +217,11 @@ for f in $tests; do
wait $awesome_pid wait $awesome_pid
code=$? code=$?
set -e set -e
[ "$code" != 0 ] && echo "Awesome exited with status code $code" case $code in
0) ;;
124) echo "Awesome was killed due to timeout after $timeout_stale seconds" ;;
*) echo "Awesome exited with status code $code" ;;
esac
if ! grep -q -E '^Test finished successfully$' $awesome_log || if ! grep -q -E '^Test finished successfully$' $awesome_log ||
grep -q -E '[Ee]rror|assertion failed' $awesome_log; then grep -q -E '[Ee]rror|assertion failed' $awesome_log; then