From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755833AbbJVAcS (ORCPT ); Wed, 21 Oct 2015 20:32:18 -0400 Received: from ozlabs.org ([103.22.144.67]:53325 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753260AbbJVAcP (ORCPT ); Wed, 21 Oct 2015 20:32:15 -0400 Message-ID: <1445473932.30295.4.camel@ellerman.id.au> Subject: Re: [RFC v3 9/9] kmsg: selftests From: Michael Ellerman To: Paul Osmialowski , Jonathan Corbet , Arnd Bergmann , Andrew Morton , Petr Mladek , Greg Kroah-Hartman , Daniel Mack , Kay Sievers , Joe Perches , Tejun Heo , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-api@vger.kernel.org Cc: Marcin Niesluchowski , Karol Lewandowski , Bartlomiej Zolnierkiewicz , Shuah Khan Date: Thu, 22 Oct 2015 11:32:12 +1100 In-Reply-To: <1445259503-18158-10-git-send-email-p.osmialowsk@samsung.com> References: <1445259503-18158-1-git-send-email-p.osmialowsk@samsung.com> <1445259503-18158-10-git-send-email-p.osmialowsk@samsung.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.5-1ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2015-10-19 at 14:58 +0200, Paul Osmialowski wrote: > This patch adds selftests framework and four test scenarios for kmsg. > > The framework shape and code was inspired by similar selftests framework > for kdbus. > diff --git a/tools/testing/selftests/kmsg/Makefile b/tools/testing/selftests/kmsg/Makefile > new file mode 100644 > index 0000000..b4ba892 > --- /dev/null > +++ b/tools/testing/selftests/kmsg/Makefile > @@ -0,0 +1,30 @@ > +CFLAGS += -I../../../../usr/include/ > +CFLAGS += -I../../../../samples/kmsg/ > +CFLAGS += -I../../../../include/uapi/ Please don't directly include the unexported kernel headers. > +CFLAGS += -std=gnu99 -Wall > +CFLAGS += -DKBUILD_MODNAME=\"kmsg\" -D_GNU_SOURCE Are you building userspace code here? I'm not sure why you need KBUILD_MODNAME. > +CFLAGS += -pthread > +LDLIBS += -pthread > + > +OBJS= \ > + kmsg-test.o \ > + test-buffer-add-del.o \ > + test-buffer-add-write-read-del.o \ > + test-buffer-buf-torture.o \ > + test-buffer-buf-multithreaded-torture.o > + > +all: kmsg-test > + > +include ../lib.mk > + > +%.o: %.c kmsg-test.h > + $(CC) $(CFLAGS) -c $< -o $@ > + > +kmsg-test: $(OBJS) > + $(CC) $(CFLAGS) $^ $(LDLIBS) -o $@ Those look the same as the implicit rules to me, so I don't think you need to spell them out. > + > +run_tests: > + ./kmsg-test --tap This should be giving you a warning about redefining run_tests. It sounds like you don't actually need to pass --tap, so you don't need to override run_tests. So you should just define: TEST_PROGS := kmsg-test Before you include lib.mk and then both the run and emit rules will work without any more work on your part. cheers