tests: Check if test file is readable before running it

I tried calling this script with "tests/foo.lua" as an argument, but it actually
expects "foo.lua" since it changes into the appropriate directory itself.
Because this file does not exist, "cat $f | awesome-client" failed and thus this
whole script just hung (the test runner was never actually started).

Fix this by testing for the test-file to exist before trying to run it.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2015-07-18 12:33:24 +02:00
parent f2a079204d
commit f4ed41b39a
1 changed files with 7 additions and 0 deletions

View File

@ -126,6 +126,13 @@ errors=0
for f in $tests; do
echo "== Running $f =="
if [ ! -r $f ]; then
echo "===> ERROR $f is not readable! <==="
errors=$(expr $errors + 1)
continue
fi
start_awesome
# Send the test file to awesome.