From patchwork Thu May 14 17:11:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Baker X-Patchwork-Id: 6408101 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 090DBC0432 for ; Thu, 14 May 2015 17:19:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 134D420460 for ; Thu, 14 May 2015 17:19:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E1D7A20328 for ; Thu, 14 May 2015 17:19:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YswjW-00010Q-34; Thu, 14 May 2015 17:15:42 +0000 Received: from mail-vn0-f45.google.com ([209.85.216.45]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YswgA-0005Uj-6M for linux-arm-kernel@lists.infradead.org; Thu, 14 May 2015 17:12:15 +0000 Received: by vnbg190 with SMTP id g190so797112vnb.3 for ; Thu, 14 May 2015 10:11:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=LKqZ/sqrym43sLjtqVS9u1W0sMTWSbVBLo/Q6HxDKg8=; b=YcreuRWR0eYTc71xokhrIchUPLdrQQialBeZzszKUYixfhN0jqhGqJ17ApXBi2GVVH bOb2FLpMRp3YdxGXaR3BlbkNEnF9SC7XMjA560faaKtA2kj331AT6UUNUfqL4fxl8WoX dPLDXIPmjisz+2LsZxw2kRoVwV87CDhOyumzSAhU2mZNYYxDxZJZMe3n/QX4b9+gUvP7 sVlaC1gMV09pMbgEIyAY1vL/HzeF5WYsvMdRoLCn2Gfzka8JDM5kqXZZ6jpz13/cMexZ I3L77tUnMyup3iERtfyPezIH3x96NO6TZQW3W3jtbbHkDYod17nuhdqOy1GbyeYUPK/K k74w== X-Gm-Message-State: ALoCoQn1tBaBN/4yW4JSuI0c8JGZUc0lIBBlmlR1m02xw3/SLn7c8e/LBHHps3f4DTjJMYUIRxrI MIME-Version: 1.0 X-Received: by 10.52.26.132 with SMTP id l4mr4730478vdg.72.1431623512106; Thu, 14 May 2015 10:11:52 -0700 (PDT) Received: by 10.52.135.114 with HTTP; Thu, 14 May 2015 10:11:52 -0700 (PDT) In-Reply-To: <5554BED4.9040204@osg.samsung.com> References: <1431467947-29847-1-git-send-email-tyler.baker@linaro.org> <1431467947-29847-3-git-send-email-tyler.baker@linaro.org> <5553C51B.6080504@osg.samsung.com> <5554BED4.9040204@osg.samsung.com> Date: Thu, 14 May 2015 10:11:52 -0700 Message-ID: Subject: Re: [PATCH 2/2] selftests/breakpoints: only set TEST_PROGS when built From: Tyler Baker To: Shuah Khan X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150514_101214_392040_CB94631C X-CRM114-Status: GOOD ( 17.57 ) X-Spam-Score: -0.7 (/) Cc: Kevin Hilman , Michael Ellerman , "linux-kernel@vger.kernel.org" , Andy Lutomirski , John Stultz , David Herrmann , Darren Hart , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 14 May 2015 at 08:27, Shuah Khan wrote: > On 05/14/2015 08:15 AM, Tyler Baker wrote: >> On 13 May 2015 at 14:41, Shuah Khan wrote: >>> On 05/12/2015 03:59 PM, tyler.baker@linaro.org wrote: >>>> From: Tyler Baker >>>> >>>> Set TEST_PROGS only when a build has occurred. >>>> >>>> Signed-off-by: Tyler Baker >>>> --- >>>> tools/testing/selftests/breakpoints/Makefile | 3 +-- >>>> 1 file changed, 1 insertion(+), 2 deletions(-) >>>> >>>> diff --git a/tools/testing/selftests/breakpoints/Makefile b/tools/testing/selftests/breakpoints/Makefile >>>> index 1822356..54cc3e7 100644 >>>> --- a/tools/testing/selftests/breakpoints/Makefile >>>> +++ b/tools/testing/selftests/breakpoints/Makefile >>>> @@ -12,12 +12,11 @@ endif >>>> all: >>>> ifeq ($(ARCH),x86) >>>> gcc breakpoint_test.c -o breakpoint_test >>>> + TEST_PROGS := breakpoint_test >>>> else >>>> echo "Not an x86 target, can't build breakpoints selftests" >>>> endif >>>> >>>> -TEST_PROGS := breakpoint_test >>>> - >>>> include ../lib.mk >>>> >>>> clean: >>>> >>> >>> Hmm. With this change install fails to copy breakpoint_test all >>> together. Remember setting TEST_PROGS in compile step makes it >>> not stick around when install target is called. A better approach >>> would be the following: >>> >>> if [ -f breakpoint_test ] >>> TEST_PROGS := breakpoint_test >>> fi >> >> Thanks for pointing this out, this is a good catch. We will also need >> to do this for the x86 tests IIRC. Would it make more sense to have >> this check performed in the INSTALL_RULE so that we don't have to have >> a bunch of IF statements in the various Makefiles? > > Right. x86 will need this type of logic for 32-bit execs when they > aren't not built on a 64-bit system, and for 64-bit execs when they > aren't built on a 32-bit system. Considering the change below we can now simplify this case for x86 to: If the binaries do not exist, they will be not be installed. If you and Andy are ok with this, I'll add a patch to this series. > >> >> Something like... >> >> @for ARTIFACT in $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES); do \ >> if [ -f $$ARTIFACT ]; then \ >> install -t $(INSTALL_PATH) $$ARTIFACT; \ >> fi; \ >> done; >> > > I think it makes perfect sense to do this in INSTALL_RULE. > As you said, this will avoid changes to test individual > Makefiles and new test writers don't have to worry about > adding this. > > Would you like make the necessary changes? Sure, I'll add this in the next revision. > > thanks, > -- Shuah > > > -- > Shuah Khan > Sr. Linux Kernel Developer > Open Source Innovation Group > Samsung Research America (Silicon Valley) > shuahkh@osg.samsung.com | (970) 217-8978 Cheers, Tyler diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile index 12d8e76..3e238d0 100644 --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@ -14,13 +14,9 @@ UNAME_M := $(shell uname -m) ifeq ($(CROSS_COMPILE),) # Always build 32-bit tests all: all_32 -# Install 32-bit tests -TEST_PROGS += $(BINARIES_32) run_x86_tests.sh # If we're on a 64-bit host, build 64-bit tests as well ifeq ($(UNAME_M),x86_64) all: all_64 -# Install 64-bit tests -TEST_PROGS += $(BINARIES_64) endif endif @@ -28,6 +24,9 @@ all_32: check_build32 $(BINARIES_32) all_64: $(BINARIES_64) +# Install the tests +TEST_PROGS := $(BINARIES_32) $(BINARIES_64) run_x86_tests.sh + include ../lib.mk clean: