summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@kernel.org>2017-08-03 13:24:36 -0700
committerShuah Khan <shuahkh@osg.samsung.com>2017-08-09 14:41:20 -0600
commit43c6437453f2e777da306c81c1cb47612e21e972 (patch)
tree5e6b4611b2a5728a8f31ded90a022f4e5a94af79 /tools
parentc0bb2cf40e42b2fe5c8aa1c4f6f4d09c98839d91 (diff)
downloadop-kernel-dev-43c6437453f2e777da306c81c1cb47612e21e972.zip
op-kernel-dev-43c6437453f2e777da306c81c1cb47612e21e972.tar.gz
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: Luis R. Rodriguez <mcgrof@kernel.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/lib.mk7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 959273c..e71f8e4 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -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
OpenPOWER on IntegriCloud