From f4ed41b39a7624ca74404d9ccd3c8e16832b8254 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 18 Jul 2015 12:33:24 +0200 Subject: [PATCH] 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 --- tests/run.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/run.sh b/tests/run.sh index d04eb0843..44d9d36b5 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -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.