Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752023AbdHCBGr (ORCPT ); Wed, 2 Aug 2017 21:06:47 -0400 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:56212 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751190AbdHCBGp (ORCPT ); Wed, 2 Aug 2017 21:06:45 -0400 Subject: Re: [PATCH] selftests: futex: fix run_tests target To: Darren Hart Cc: shuah@kernel.org, tglx@linutronix.de, mingo@redhat.com, peterz@infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Shuah Khan , Shuah Khan References: <20170802223142.20282-1-shuahkh@osg.samsung.com> <20170803005222.GC27974@fury> From: Shuah Khan Message-ID: <95d21b7c-be98-a8f5-fe67-ec4877d4a946@osg.samsung.com> Date: Wed, 2 Aug 2017 19:06:39 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170803005222.GC27974@fury> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2096 Lines: 62 On 08/02/2017 06:52 PM, Darren Hart wrote: > On Wed, Aug 02, 2017 at 04:31:42PM -0600, Shuah Khan wrote: >> make -C tools/testing/selftests/futex/ run_tests doesn't run the tests. >> Running run_tests target only when $(OUTPUT) is the $(PWD) is incorrect. >> When $(OUTPUT) is empty, run_tests will not run. Fix it. >> >> Fixes: a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT") >> Signed-off-by: Shuah Khan > > So this indeed addresses the problem you reported. > > I'm curious about why this was changed like it was. I presume to avoid > some issues with relative paths, like the ./run.sh and the "cd > functional" within run.sh.... but I haven't been able to trigger that.> > When you say $(OUTPUT) is empty - when does that occur? Because if it > was in fact "" then the change below would attempt to execute /run.sh > ... which is surely not what we want. This will not happen. At this stage, OUTPUT will not be empty. I didn't explain the condition correctly in my change log. When OUTPUT isn't set (which is the usual case when test is run using: make -C tools/testing/selftests/futex run_tests lib.mk sets it to OUTPUT := $(shell pwd) So OUTPUT will be the current directory when run_tests are run. > >> --- >> tools/testing/selftests/futex/Makefile | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/tools/testing/selftests/futex/Makefile b/tools/testing/selftests/futex/Makefile >> index e2fbb890aef9..7c647f619d63 100644 >> --- a/tools/testing/selftests/futex/Makefile >> +++ b/tools/testing/selftests/futex/Makefile >> @@ -14,7 +14,7 @@ all: >> done >> >> override define RUN_TESTS >> - @if [ `dirname $(OUTPUT)` = $(PWD) ]; then ./run.sh; fi The above change was made in conjunction with the a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT") The above change didn't anticipate failures when tests are run outside the selftests/Makefile umbrella via make -C tools/testing/selftests/testdir >> + $(OUTPUT)/run.sh >> endef >> >> override define INSTALL_RULE >> -- >> 2.11.0 >> >> > thanks, -- Shuah