lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 22 Oct 2015 11:32:12 +1100
From:	Michael Ellerman <mpe@...erman.id.au>
To:	Paul Osmialowski <p.osmialowsk@...sung.com>,
	Jonathan Corbet <corbet@....net>,
	Arnd Bergmann <arnd@...db.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Petr Mladek <pmladek@...e.cz>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Daniel Mack <daniel@...que.org>,
	Kay Sievers <kay.sievers@...y.org>,
	Joe Perches <joe@...ches.com>, Tejun Heo <tj@...nel.org>,
	linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
	linux-api@...r.kernel.org
Cc:	Marcin Niesluchowski <m.niesluchow@...sung.com>,
	Karol Lewandowski <k.lewandowsk@...sung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
	Shuah Khan <shuahkh@....samsung.com>
Subject: Re: [RFC v3 9/9] kmsg: selftests

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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists