diff options
author | Shuah Khan (Samsung OSG) <shuah@kernel.org> | 2018-05-01 22:38:47 +0200 |
---|---|---|
committer | Shuah Khan (Samsung OSG) <shuah@kernel.org> | 2018-05-30 23:21:52 +0200 |
commit | a548de0fe8e18be6bc15d8e41ad2a1728886d0dc (patch) | |
tree | 53ac49b43b2a44e647cf60f56fc29d926b2400e7 /tools/testing/selftests/lib.mk | |
parent | selftests: lib.mk: add SKIP handling and test suite name to EMIT_TESTS (diff) | |
download | linux-a548de0fe8e18be6bc15d8e41ad2a1728886d0dc.tar.xz linux-a548de0fe8e18be6bc15d8e41ad2a1728886d0dc.zip |
selftests: lib.mk: add test execute bit check to EMIT_TESTS
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>
Diffstat (limited to 'tools/testing/selftests/lib.mk')
-rw-r--r-- | tools/testing/selftests/lib.mk | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 0c6012500026..6466294366dc 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -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 |