Thread (34 messages) 34 messages, 4 authors, 2014-12-03

Re: [PATCH v2 11/19] selftests/memory-hotplug: add install target to enable installing test

From: Shuah Khan <hidden>
Date: 2014-12-01 16:12:52
Also in: linux-api, linux-kbuild, lkml

On 11/26/2014 10:49 PM, Masami Hiramatsu wrote:
(2014/11/12 5:27), Shuah Khan wrote:
quoted
Add a new make target to enable installing test. This target
installs test in the kselftest install location and add to the
kselftest script to run the test. Install target can be run
only from top level source dir.

Signed-off-by: Shuah Khan <redacted>
---
 tools/testing/selftests/memory-hotplug/Makefile    |  17 +-
 .../selftests/memory-hotplug/mem-on-off-test.sh    | 238 +++++++++++++++++++++
 .../selftests/memory-hotplug/on-off-test.sh        | 238 ---------------------
 3 files changed, 253 insertions(+), 240 deletions(-)
 create mode 100644 tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
 delete mode 100644 tools/testing/selftests/memory-hotplug/on-off-test.sh
diff --git a/tools/testing/selftests/memory-hotplug/Makefile b/tools/testing/selftests/memory-hotplug/Makefile
index d46b8d4..8921631 100644
--- a/tools/testing/selftests/memory-hotplug/Makefile
+++ b/tools/testing/selftests/memory-hotplug/Makefile
@@ -1,9 +1,22 @@
+TEST_STR=/bin/bash ./mem-on-off-test.sh -r 2 || echo memory-hotplug selftests: [FAIL]
+
 all:
 
+install:
+ifdef INSTALL_KSFT_PATH
+	install ./mem-on-off-test.sh $(INSTALL_KSFT_PATH)/mem-on-off-test.sh
+	@echo echo Start memory hotplug test .... >> $(KSELFTEST)
+	@echo "$(TEST_STR)" >> $(KSELFTEST) >> $(KSELFTEST)
+	@echo echo End memory hotplug test .... >> $(KSELFTEST)
+	@echo echo ============================== >> $(KSELFTEST)
+else
+	@echo Run make kselftest_install in top level source directory
+endif
I saw this pattern repeated many times in this series.
Can we make it a macro and include it instead of repeating this code?
I might be able to move this to the selftest Makfile and use target as the
string. I will play with it and see if I can reduce the duplication further.

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help