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:
parent
f2a079204d
commit
f4ed41b39a
|
@ -126,6 +126,13 @@ errors=0
|
||||||
|
|
||||||
for f in $tests; do
|
for f in $tests; do
|
||||||
echo "== Running $f =="
|
echo "== Running $f =="
|
||||||
|
|
||||||
|
if [ ! -r $f ]; then
|
||||||
|
echo "===> ERROR $f is not readable! <==="
|
||||||
|
errors=$(expr $errors + 1)
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
start_awesome
|
start_awesome
|
||||||
|
|
||||||
# Send the test file to awesome.
|
# Send the test file to awesome.
|
||||||
|
|
Loading…
Reference in New Issue