Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932698AbdHWUut (ORCPT ); Wed, 23 Aug 2017 16:50:49 -0400 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:43858 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932649AbdHWUus (ORCPT ); Wed, 23 Aug 2017 16:50:48 -0400 From: Shuah Khan To: shuah@kernel.org, john.stultz@linaro.org Cc: Shuah Khan , tglx@linutronix.de, sboyd@codeaurora.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] selftests: change lib.mk RUN_TESTS to take test list as an argument Date: Wed, 23 Aug 2017 14:50:43 -0600 Message-Id: <20170823205043.25026-1-shuahkh@osg.samsung.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2548 Lines: 65 Change lib.mk RUN_TESTS to take test list as an argument. This will allow it to be called from individual test makefiles to run additional tests that aren't suitable for a default kselftest run. As an example, timers test includes destructive tests that aren't included in the common run_tests target. Change times/Makefile to use RUN_TESTS call with destructive test list as an argument instead of using its own RUN_TESTS target. Signed-off-by: Shuah Khan --- tools/testing/selftests/lib.mk | 4 ++-- tools/testing/selftests/timers/Makefile | 14 +------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 02989b2465a3..4e5a55e97c52 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -12,7 +12,7 @@ TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES)) all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) define RUN_TESTS - @for TEST in $(TEST_GEN_PROGS) $(TEST_PROGS); do \ + @for TEST in $(1); do \ BASENAME_TEST=`basename $$TEST`; \ if [ ! -x $$BASENAME_TEST ]; then \ echo "selftests: Warning: file $$BASENAME_TEST is not executable, correct this.";\ @@ -24,7 +24,7 @@ define RUN_TESTS endef run_tests: all - $(RUN_TESTS) + $(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_PROGS)) define INSTALL_RULE @if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then \ diff --git a/tools/testing/selftests/timers/Makefile b/tools/testing/selftests/timers/Makefile index de85358ae937..ae4593115408 100644 --- a/tools/testing/selftests/timers/Makefile +++ b/tools/testing/selftests/timers/Makefile @@ -15,20 +15,8 @@ TEST_GEN_PROGS_EXTENDED = $(DESTRUCTIVE_TESTS) rtctest_setdate include ../lib.mk -define RUN_DESTRUCTIVE_TESTS - @for TEST in $(DESTRUCTIVE_TESTS); do \ - BASENAME_TEST=`basename $$TEST`; \ - if [ ! -x $$BASENAME_TEST ]; then \ - echo "selftests: Warning: file $$BASENAME_TEST is not executable, correct this.";\ - echo "selftests: $$BASENAME_TEST [FAIL]"; \ - else \ - cd `dirname $$TEST` > /dev/null; (./$$BASENAME_TEST && echo "selftests: $$BASENAME_TEST [PASS]") || echo "selftests: $$BASENAME_TEST [FAIL]"; cd - > /dev/null;\ - fi; \ - done; -endef - # these tests require escalated privileges # and may modify the system time or trigger # other behavior like suspend run_destructive_tests: run_tests - $(RUN_DESTRUCTIVE_TESTS) + $(call RUN_TESTS, $(DESTRUCTIVE_TESTS)) -- 2.11.0