selftests: check before install
authorBamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Fri, 14 Aug 2015 13:43:35 +0000 (21:43 +0800)
committerShuah Khan <shuahkh@osg.samsung.com>
Thu, 27 Aug 2015 22:04:15 +0000 (16:04 -0600)
When the test cases is not supported by the current architecture
the install files(TEST_PROGS, TEST_PROGS_EXTENDED and TEST_FILES)
will be empty. Check it before installation to dismiss a failure
reported by install program.

Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/Makefile
tools/testing/selftests/lib.mk

index 9763dd95b4c82c7a332f1d1b08c1d884598a7af3..b2179587c8fe04a3df57c85bf7f12fee73313f5b 100644 (file)
@@ -72,7 +72,6 @@ ifdef INSTALL_PATH
        @# Ask all targets to install their files
        mkdir -p $(INSTALL_PATH)
        for TARGET in $(TARGETS); do \
-               mkdir -p $(INSTALL_PATH)/$$TARGET ; \
                make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
        done;
 
index ee412bab7ed4bd29c264af117398be85b1999c4d..97f1c6742066352c6fd0a32599ecff93b3896499 100644 (file)
@@ -12,11 +12,14 @@ run_tests: all
        $(RUN_TESTS)
 
 define INSTALL_RULE
-       mkdir -p $(INSTALL_PATH)
-       @for TEST_DIR in $(TEST_DIRS); do\
-               cp -r $$TEST_DIR $(INSTALL_PATH); \
-       done;
-       install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
+       @if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then                        \
+               mkdir -p $(INSTALL_PATH);                                                               \
+               for TEST_DIR in $(TEST_DIRS); do                                                        \
+                       cp -r $$TEST_DIR $(INSTALL_PATH);                                               \
+               done;                                                                                   \
+               echo "install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)";   \
+               install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES);          \
+       fi
 endef
 
 install: all