Make the functional test runner more robust

Currently, an error in the default config in the right place isn't noticed. Fix
this by doing two things:

- Also grep for "error" (this catches runtime errors with a stack trace)
- Make _runner print a "success" message at the end and also grep for that

Fixes: https://github.com/awesomeWM/awesome/issues/689
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-02-12 18:12:21 +01:00
parent 0a15ea9131
commit f87da55dfc
2 changed files with 6 additions and 2 deletions

View File

@ -79,6 +79,9 @@ runner.run_steps = function(steps)
for _,c in ipairs(client.get()) do for _,c in ipairs(client.get()) do
c:kill() c:kill()
end end
if success and result then
io.stderr:write("Test finished successfully\n")
end
awesome.quit() awesome.quit()
end) end) end) end)
t:start() t:start()

View File

@ -169,9 +169,10 @@ for f in $tests; do
# Tail the log and quit, when awesome quits. # Tail the log and quit, when awesome quits.
tail -n 100000 -f --pid $awesome_pid $awesome_log tail -n 100000 -f --pid $awesome_pid $awesome_log
if grep -q -E '^Error|assertion failed' $awesome_log; then if ! grep -q -E '^Test finished successfully$' $awesome_log ||
grep -q -E '[Ee]rror|assertion failed' $awesome_log; then
echo "===> ERROR running $f! <===" echo "===> ERROR running $f! <==="
grep --color -o --binary-files=text -E '^Error.*|.*assertion failed.*' $awesome_log grep --color -o --binary-files=text -E '.*[Ee]rror.*|.*assertion failed.*' $awesome_log
errors=$(expr $errors + 1) errors=$(expr $errors + 1)
fi fi
done done