Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1253368

Re: [RFC v3 9/9] kmsg: selftests

From Michael Ellerman <mpe@ellerman.id.au>
Newsgroups linux.kernel
Subject Re: [RFC v3 9/9] kmsg: selftests
Date 2015-10-22 02:40 +0200
Message-ID <qmc5c-2zR-5@gated-at.bofh.it> (permalink)
References <qlicF-4P7-7@gated-at.bofh.it> <qlicG-4P7-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[RFC v3 9/9] kmsg: selftests Paul Osmialowski <p.osmialowsk@samsung.com> - 2015-10-19 15:00 +0200
  Re: [RFC v3 9/9] kmsg: selftests Michael Ellerman <mpe@ellerman.id.au> - 2015-10-22 02:40 +0200

csiph-web