diff options
author | Shuah Khan <shuahkh@osg.samsung.com> | 2017-09-11 19:03:11 -0600 |
---|---|---|
committer | Shuah Khan <shuahkh@osg.samsung.com> | 2017-09-21 07:55:40 -0600 |
commit | 1a940687e424080a6ed285f2de8b2f0d018edf3e (patch) | |
tree | 0790ebe537ef48befdeba0256db18b4f5eaa396d /tools | |
parent | b2fc6ade9fe2118591e7f51e21b51f65e36f138f (diff) | |
download | linux-1a940687e424080a6ed285f2de8b2f0d018edf3e.tar.gz linux-1a940687e424080a6ed285f2de8b2f0d018edf3e.tar.bz2 linux-1a940687e424080a6ed285f2de8b2f0d018edf3e.zip |
selftests: lib.mk: copy test scripts and test files for make O=dir run
For make O=dir run_tests to work, test scripts, test files, and other
dependencies need to be copied over to the object directory. Running
tests from the object directory is necessary to avoid making the source
tree dirty.
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/lib.mk | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index b4699c71aee4..f65886af7c0c 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -37,7 +37,18 @@ define RUN_TESTS endef run_tests: all +ifneq ($(KBUILD_SRC),) + @if [ "X$(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)" != "X" ]; then + @rsync -aq $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(OUTPUT) + fi + @if [ "X$(TEST_PROGS)" != "X" ]; then + $(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(OUTPUT)/$(TEST_PROGS)) + else + $(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS)) + fi +else $(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_PROGS)) +endif define INSTALL_RULE @if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then \ |