]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
selftests: lib.mk: add test execute bit check to EMIT_TESTS
authorShuah Khan (Samsung OSG) <shuah@kernel.org>
Tue, 1 May 2018 20:38:47 +0000 (14:38 -0600)
committerShuah Khan (Samsung OSG) <shuah@kernel.org>
Wed, 30 May 2018 21:21:52 +0000 (15:21 -0600)
Similar to what RUN_TESTS does, change EMIT_TESTS to check for execute
bit and emit code to print warnings if test isn't executable to the
the run_kselftest.sh.

Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
tools/testing/selftests/lib.mk

index 0c6012500026ff79b80dacf3012724cc228ca244..6466294366dcdab72b51e8724c3975133b9ab3c3 100644 (file)
@@ -100,7 +100,12 @@ define EMIT_TESTS
                test_num=`echo $$test_num+1 | bc`;      \
                TEST_HDR_MSG="selftests: "`basename $$PWD`:" $$BASENAME_TEST";  \
                echo "echo $$TEST_HDR_MSG";     \
-               echo "(./$$BASENAME_TEST >> \$$OUTPUT 2>&1 && echo \"ok 1..$$test_num $$TEST_HDR_MSG [PASS]\") || (if [ \$$? -eq \$$skip ]; then echo \"not ok 1..$$test_num $$TEST_HDR_MSG [SKIP]\"; else echo \"not ok 1..$$test_num $$TEST_HDR_MSG [FAIL]\"; fi;)"; \
+               if [ ! -x $$TEST ]; then        \
+                       echo "echo \"$$TEST_HDR_MSG: Warning: file $$BASENAME_TEST is not executable, correct this.\"";         \
+                       echo "echo \"not ok 1..$$test_num $$TEST_HDR_MSG [FAIL]\""; \
+               else
+                       echo "(./$$BASENAME_TEST >> \$$OUTPUT 2>&1 && echo \"ok 1..$$test_num $$TEST_HDR_MSG [PASS]\") || (if [ \$$? -eq \$$skip ]; then echo \"not ok 1..$$test_num $$TEST_HDR_MSG [SKIP]\"; else echo \"not ok 1..$$test_num $$TEST_HDR_MSG [FAIL]\"; fi;)"; \
+               fi;             \
        done;
 endef