From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751959AbdHCQ7x (ORCPT ); Thu, 3 Aug 2017 12:59:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:53598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751916AbdHCQ7G (ORCPT ); Thu, 3 Aug 2017 12:59:06 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5047D22BF3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=mcgrof@kernel.org From: "Luis R. Rodriguez" To: shuah@kernel.org, linux-kselftest@vger.kernel.org Cc: akpm@linux-foundation.org, keescook@chromium.org, pmladek@suse.com, dan.carpenter@oracle.com, colin.king@canonical.com, dcb314@hotmail.com, linux-kernel@vger.kernel.org, "Luis R. Rodriguez" Subject: [PATCH] selftests: use $SHELL to exec selftests Date: Thu, 3 Aug 2017 09:59:00 -0700 Message-Id: <20170803165900.4897-1-mcgrof@kernel.org> X-Mailer: git-send-email 2.13.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Executing selftests is fragile as if someone forgot to set a secript as executable the test will fail. Setting scripts as executable is desirable to enable folks to execute tests as independent units, however, we can avoid the fragile errors of forgetting to set the script as executable by just invoking the $SHELL for running each script. Suggsted-by: Andrew Morton Signed-off-by: Luis R. Rodriguez --- Shuah, while the last two patches could be queued in for 4.13-final, this one I think is more appropriate for v4.14-rc1 only. tools/testing/selftests/lib.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 959273c3a52e..2d6abb8037be 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -14,7 +14,7 @@ all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) define RUN_TESTS @for TEST in $(TEST_GEN_PROGS) $(TEST_PROGS); do \ BASENAME_TEST=`basename $$TEST`; \ - cd `dirname $$TEST`; (./$$BASENAME_TEST && echo "selftests: $$BASENAME_TEST [PASS]") || echo "selftests: $$BASENAME_TEST [FAIL]"; cd -;\ + cd `dirname $$TEST`; ($$SHELL ./$$BASENAME_TEST && echo "selftests: $$BASENAME_TEST [PASS]") || echo "selftests: $$BASENAME_TEST [FAIL]"; cd -;\ done; endef -- 2.11.0