Commit 43c64374 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by Shuah Khan

selftests: warn if failure is due to lack of executable bit

Executing selftests is fragile as if someone forgot to set a secript
as executable the test will fail, and you won't know for sure if the
failure was caused by the lack of proper permissions or something else.

Setting scripts as executable is required, this also enable folks to
execute selftests as independent units.
Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
parent c0bb2cf4
......@@ -14,7 +14,12 @@ all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES)
define RUN_TESTS
@for TEST in $(TEST_GEN_PROGS) $(TEST_PROGS); do \
BASENAME_TEST=`basename $$TEST`; \
cd `dirname $$TEST`; (./$$BASENAME_TEST && echo "selftests: $$BASENAME_TEST [PASS]") || echo "selftests: $$BASENAME_TEST [FAIL]"; cd -;\
if [ ! -x $$BASENAME_TEST ]; then \
echo "selftests: Warning: file $$BASENAME_TEST is not executable, correct this.";\
echo "selftests: $$BASENAME_TEST [FAIL]"; \
else \
cd `dirname $$TEST`; (./$$BASENAME_TEST && echo "selftests: $$BASENAME_TEST [PASS]") || echo "selftests: $$BASENAME_TEST [FAIL]"; cd -;\
fi; \
done;
endef
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment