Re: [PATCH v18 00/19] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-10-07 Thread Brendan Higgins
On Sun, Oct 6, 2019 at 10:18 AM Linus Torvalds wrote: > > On Sun, Oct 6, 2019 at 9:55 AM Theodore Y. Ts'o wrote: > > > > Well, one thing we *can* do is if (a) if we can create a kselftest > > branch which we know is stable and won't change, and (b) we can get > > assurances that Linus *will* acce

Re: [PATCH v18 00/19] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-10-07 Thread Brendan Higgins
On Sun, Oct 6, 2019 at 9:55 AM Theodore Y. Ts'o wrote: > > On Fri, Oct 04, 2019 at 06:18:04PM -0700, Brendan Higgins wrote: > > > Let's talk about current state. Right now kunit is in linux-next and > > > we want to add a few more tests. We will have to coordinat

Re: [PATCH v18 00/19] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-10-04 Thread Brendan Higgins
On Fri, Oct 4, 2019 at 5:49 PM shuah wrote: > > On 10/4/19 6:33 PM, Brendan Higgins wrote: > > On Fri, Oct 4, 2019 at 4:57 PM shuah wrote: > >> > >> On 10/4/19 5:52 PM, Brendan Higgins wrote: > >>> On Fri, Oct 4, 2019 at 4:30 PM Theodore Y. Ts'o

Re: [PATCH v18 00/19] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-10-04 Thread Brendan Higgins
On Fri, Oct 4, 2019 at 4:57 PM shuah wrote: > > On 10/4/19 5:52 PM, Brendan Higgins wrote: > > On Fri, Oct 4, 2019 at 4:30 PM Theodore Y. Ts'o wrote: > >> > >> On Fri, Oct 04, 2019 at 04:47:09PM -0600, shuah wrote: > >>>> However, if I en

Re: [PATCH v18 00/19] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-10-04 Thread Brendan Higgins
On Fri, Oct 4, 2019 at 4:30 PM Theodore Y. Ts'o wrote: > > On Fri, Oct 04, 2019 at 04:47:09PM -0600, shuah wrote: > > > However, if I encourage arbitrary tests/improvements into my KUnit > > > branch, it further diverges away from torvalds/master, and is more > > > likely that there will be a merg

Re: [PATCH v18 00/19] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-10-04 Thread Brendan Higgins
On Fri, Oct 4, 2019 at 3:47 PM shuah wrote: > > On 10/4/19 4:27 PM, Brendan Higgins wrote: > > On Fri, Oct 04, 2019 at 03:59:10PM -0600, shuah wrote: > >> On 10/4/19 3:42 PM, Linus Torvalds wrote: > >>> On Fri, Oct 4, 2019 at 2:39 PM Theodore Y. Ts'o

Re: [PATCH v18 00/19] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-10-04 Thread Brendan Higgins
On Fri, Oct 04, 2019 at 03:59:10PM -0600, shuah wrote: > On 10/4/19 3:42 PM, Linus Torvalds wrote: > > On Fri, Oct 4, 2019 at 2:39 PM Theodore Y. Ts'o wrote: > > > > > > This question is primarily directed at Shuah and Linus > > > > > > What's the current status of the kunit series now that

Re: [PATCH v18 15/19] Documentation: kunit: add documentation for KUnit

2019-09-23 Thread Brendan Higgins
On Mon, Sep 23, 2019 at 8:48 AM Randy Dunlap wrote: > > On 9/23/19 2:02 AM, Brendan Higgins wrote: > > Add documentation for KUnit, the Linux kernel unit testing framework. > > - Add intro and usage guide for KUnit > > - Add API reference > > > > Signed-

Re: [PATCH v17 07/19] kunit: test: add initial tests

2019-09-23 Thread Brendan Higgins
On Sun, Sep 22, 2019 at 9:28 AM Randy Dunlap wrote: > > On 9/20/19 5:18 PM, Brendan Higgins wrote: > > Add a test for string stream along with a simpler example. > > > > Signed-off-by: Brendan Higgins > > Reviewed-by: Greg Kroah-Hartman > > Reviewed-by: Logan

[PATCH v18 15/19] Documentation: kunit: add documentation for KUnit

2019-09-23 Thread Brendan Higgins
Add documentation for KUnit, the Linux kernel unit testing framework. - Add intro and usage guide for KUnit - Add API reference Signed-off-by: Felix Guo Signed-off-by: Brendan Higgins Cc: Jonathan Corbet Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd

[PATCH v18 18/19] MAINTAINERS: add proc sysctl KUnit test to PROC SYSCTL section

2019-09-23 Thread Brendan Higgins
Add entry for the new proc sysctl KUnit test to the PROC SYSCTL section, and add Iurii as a maintainer. Signed-off-by: Brendan Higgins Cc: Iurii Zaikin Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Acked-by: Luis Chamberlain --- MAINTAINERS | 2 ++ 1 file changed, 2

[PATCH v18 17/19] kernel/sysctl-test: Add null pointer test for sysctl.c:proc_dointvec()

2019-09-23 Thread Brendan Higgins
From: Iurii Zaikin KUnit tests for initialized data behavior of proc_dointvec that is explicitly checked in the code. Includes basic parsing tests including int min/max overflow. Signed-off-by: Iurii Zaikin Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan

[PATCH v18 14/19] kunit: defconfig: add defconfigs for building KUnit tests

2019-09-23 Thread Brendan Higgins
Add defconfig for UML and a fragment that can be used to configure other architectures for building KUnit tests. Add option to kunit_tool to use a defconfig to create the kunitconfig. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by

[PATCH v18 19/19] kunit: fix failure to build without printk

2019-09-23 Thread Brendan Higgins
Stephen Rothwell Cc: Sergey Senozhatsky Cc: Joe Perches Cc: tim.b...@sony.com Signed-off-by: Brendan Higgins Acked-by: Randy Dunlap # build-tested Reviewed-by: Petr Mladek --- include/kunit/test.h | 5 ++-- lib/kunit/test.c | 57 +--- 2 files changed,

[PATCH v18 02/19] kunit: test: add test resource management API

2019-09-23 Thread Brendan Higgins
;test resources" which are managed by the test infrastructure and are automatically cleaned up at the conclusion of the test. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- include/kunit/te

[PATCH v18 03/19] kunit: test: add string_stream a std::stream like string builder

2019-09-23 Thread Brendan Higgins
ilder, nothing more. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- include/kunit/string-stream.h | 51 lib/kunit/Makefile| 3 +- lib/kunit/string-stream.c | 217

[PATCH v18 13/19] kunit: tool: add Python wrappers for running KUnit tests

2019-09-23 Thread Brendan Higgins
: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- tools/testing/kunit/.gitignore| 3 + tools/testing/kunit/kunit.py | 116 +++ tools/testing/kunit/kunit_config.py | 66 tools/testing/kunit

[PATCH v18 11/19] kunit: test: add the concept of assertions

2019-09-23 Thread Brendan Higgins
still express the idea of a premise using the above idiom, but I think KUNIT_ASSERT_* states the intended idea perfectly. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- include/kunit/test.h

[PATCH v18 07/19] kunit: test: add initial tests

2019-09-23 Thread Brendan Higgins
Add a test for string stream along with a simpler example. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- lib/kunit/Kconfig | 23 + lib/kunit/Makefile | 4 ++ lib/kunit/example-test.c

[PATCH v18 16/19] MAINTAINERS: add entry for KUnit the unit testing framework

2019-09-23 Thread Brendan Higgins
Add myself as maintainer of KUnit, the Linux kernel's unit testing framework. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- MAINTAINERS | 11 +++ 1 file changed, 11 insertions(+) diff --git a/MAINTAIN

[PATCH v18 12/19] kunit: test: add tests for KUnit managed resources

2019-09-23 Thread Brendan Higgins
: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- lib/kunit/test-test.c | 228 ++ 1 file changed, 228 insertions(+) diff --git a/lib/kunit/test-test.c b/lib/kunit/test-test.c index e0ab4bd546ea

[PATCH v18 06/19] lib: enable building KUnit in lib/

2019-09-23 Thread Brendan Higgins
KUnit is a new unit testing framework for the kernel and when used is built into the kernel as a part of it. Add KUnit to the lib Kconfig and Makefile to allow it to be actually built. Signed-off-by: Brendan Higgins Cc: Randy Dunlap Cc: Andrew Morton Cc: Masahiro Yamada Cc: Kees Cook

[PATCH v18 08/19] objtool: add kunit_try_catch_throw to the noreturn list

2019-09-23 Thread Brendan Higgins
kernel, to bail out of a broken test. As a consequence, it is a new __noreturn function that objtool thinks is broken (as seen above). So fix this warning by adding kunit_try_catch_throw to objtool's noreturn list. Reported-by: kbuild test robot Signed-off-by: Brendan Higgins Acked-by:

[PATCH v18 09/19] kunit: test: add support for test abort

2019-09-23 Thread Brendan Higgins
. Logically speaking, these are the premises of the test case, so if a premise isn't true, there is no point in continuing the test case because there are no conclusions that can be drawn without the premises. Whereas, the expectation is the thing you are trying to prove. Signed-off-by: Brendan Hi

[PATCH v18 10/19] kunit: test: add tests for kunit test abort

2019-09-23 Thread Brendan Higgins
Add KUnit tests for the KUnit test abort mechanism (see preceding commit). Add tests both for general try catch mechanism as well as non-architecture specific mechanism. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd

[PATCH v18 05/19] kunit: test: add the concept of expectations

2019-09-23 Thread Brendan Higgins
Add support for expectations, which allow properties to be specified and then verified in tests. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- include/kunit/test.h | 836

[PATCH v18 04/19] kunit: test: add assertion printing library

2019-09-23 Thread Brendan Higgins
Add `struct kunit_assert` and friends which provide a structured way to capture data from an expectation or an assertion (introduced later in the series) so that it may be printed out in the event of a failure. Signed-off-by: Brendan Higgins Reviewed-by: Stephen Boyd --- include/kunit/assert.h

[PATCH v18 01/19] kunit: test: add KUnit test runner core

2019-09-23 Thread Brendan Higgins
them test_modules). Just define test cases and how to execute them for now; setting expectations on code will be defined later. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Luis Chamberlain Reviewed-by: Stephen Boyd --- include/kunit

[PATCH v18 00/19] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-09-23 Thread Brendan Higgins
d_party/kernel/docs/usage.html#kunit-on-non-uml-architectures [4] https://google.github.io/kunit-docs/third_party/kernel/docs/ [5] https://kunit.googlesource.com/linux/+/kunit/initial/v5.3/v18 --- Avinash Kondareddy (1): kunit: test: add tests for KUnit managed resources Brendan Higgins (16):

[PATCH v17 02/19] kunit: test: add test resource management API

2019-09-20 Thread Brendan Higgins
;test resources" which are managed by the test infrastructure and are automatically cleaned up at the conclusion of the test. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- include/kunit/te

[PATCH v17 06/19] lib: enable building KUnit in lib/

2019-09-20 Thread Brendan Higgins
KUnit is a new unit testing framework for the kernel and when used is built into the kernel as a part of it. Add KUnit to the lib Kconfig and Makefile to allow it to be actually built. Signed-off-by: Brendan Higgins Cc: Randy Dunlap Cc: Andrew Morton Cc: Masahiro Yamada Cc: Kees Cook

[PATCH v17 16/19] MAINTAINERS: add entry for KUnit the unit testing framework

2019-09-20 Thread Brendan Higgins
Add myself as maintainer of KUnit, the Linux kernel's unit testing framework. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- MAINTAINERS | 11 +++ 1 file changed, 11 insertions(+) diff --git a/MAINTAIN

[PATCH v17 14/19] kunit: defconfig: add defconfigs for building KUnit tests

2019-09-20 Thread Brendan Higgins
Add defconfig for UML and a fragment that can be used to configure other architectures for building KUnit tests. Add option to kunit_tool to use a defconfig to create the kunitconfig. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by

[PATCH v17 12/19] kunit: test: add tests for KUnit managed resources

2019-09-20 Thread Brendan Higgins
: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- lib/kunit/test-test.c | 228 ++ 1 file changed, 228 insertions(+) diff --git a/lib/kunit/test-test.c b/lib/kunit/test-test.c index e0ab4bd546ea

[PATCH v17 09/19] kunit: test: add support for test abort

2019-09-20 Thread Brendan Higgins
. Logically speaking, these are the premises of the test case, so if a premise isn't true, there is no point in continuing the test case because there are no conclusions that can be drawn without the premises. Whereas, the expectation is the thing you are trying to prove. Signed-off-by: Brendan Hi

[PATCH v17 13/19] kunit: tool: add Python wrappers for running KUnit tests

2019-09-20 Thread Brendan Higgins
: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- tools/testing/kunit/.gitignore| 3 + tools/testing/kunit/kunit.py | 116 +++ tools/testing/kunit/kunit_config.py | 66 tools/testing/kunit

[PATCH v17 17/19] kernel/sysctl-test: Add null pointer test for sysctl.c:proc_dointvec()

2019-09-20 Thread Brendan Higgins
From: Iurii Zaikin KUnit tests for initialized data behavior of proc_dointvec that is explicitly checked in the code. Includes basic parsing tests including int min/max overflow. Signed-off-by: Iurii Zaikin Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan

[PATCH v17 19/19] kunit: fix failure to build without printk

2019-09-20 Thread Brendan Higgins
Stephen Rothwell Cc: Sergey Senozhatsky Cc: Joe Perches Cc: tim.b...@sony.com Signed-off-by: Brendan Higgins Acked-by: Randy Dunlap # build-tested Reviewed-by: Petr Mladek --- include/kunit/test.h | 5 ++-- lib/kunit/test.c | 57 +--- 2 files changed,

[PATCH v17 08/19] objtool: add kunit_try_catch_throw to the noreturn list

2019-09-20 Thread Brendan Higgins
kernel, to bail out of a broken test. As a consequence, it is a new __noreturn function that objtool thinks is broken (as seen above). So fix this warning by adding kunit_try_catch_throw to objtool's noreturn list. Reported-by: kbuild test robot Signed-off-by: Brendan Higgins Acked-by:

[PATCH v17 18/19] MAINTAINERS: add proc sysctl KUnit test to PROC SYSCTL section

2019-09-20 Thread Brendan Higgins
Add entry for the new proc sysctl KUnit test to the PROC SYSCTL section, and add Iurii as a maintainer. Signed-off-by: Brendan Higgins Cc: Iurii Zaikin Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Acked-by: Luis Chamberlain --- MAINTAINERS | 2 ++ 1 file changed, 2

[PATCH v17 01/19] kunit: test: add KUnit test runner core

2019-09-20 Thread Brendan Higgins
them test_modules). Just define test cases and how to execute them for now; setting expectations on code will be defined later. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Luis Chamberlain Reviewed-by: Stephen Boyd --- include/kunit

[PATCH v17 00/19] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-09-20 Thread Brendan Higgins
vinash Kondareddy (1): kunit: test: add tests for KUnit managed resources Brendan Higgins (16): kunit: test: add KUnit test runner core kunit: test: add test resource management API kunit: test: add string_stream a std::stream like string builder kunit: test: add assertion printing

[PATCH v17 10/19] kunit: test: add tests for kunit test abort

2019-09-20 Thread Brendan Higgins
Add KUnit tests for the KUnit test abort mechanism (see preceding commit). Add tests both for general try catch mechanism as well as non-architecture specific mechanism. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd

[PATCH v17 11/19] kunit: test: add the concept of assertions

2019-09-20 Thread Brendan Higgins
still express the idea of a premise using the above idiom, but I think KUNIT_ASSERT_* states the intended idea perfectly. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- include/kunit/test.h

[PATCH v17 03/19] kunit: test: add string_stream a std::stream like string builder

2019-09-20 Thread Brendan Higgins
ilder, nothing more. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- include/kunit/string-stream.h | 51 lib/kunit/Makefile| 3 +- lib/kunit/string-stream.c | 217

[PATCH v17 15/19] Documentation: kunit: add documentation for KUnit

2019-09-20 Thread Brendan Higgins
Add documentation for KUnit, the Linux kernel unit testing framework. - Add intro and usage guide for KUnit - Add API reference Signed-off-by: Felix Guo Signed-off-by: Brendan Higgins Cc: Jonathan Corbet Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd

[PATCH v17 04/19] kunit: test: add assertion printing library

2019-09-20 Thread Brendan Higgins
Add `struct kunit_assert` and friends which provide a structured way to capture data from an expectation or an assertion (introduced later in the series) so that it may be printed out in the event of a failure. Signed-off-by: Brendan Higgins Reviewed-by: Stephen Boyd --- include/kunit/assert.h

[PATCH v17 07/19] kunit: test: add initial tests

2019-09-20 Thread Brendan Higgins
Add a test for string stream along with a simpler example. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- lib/kunit/Kconfig | 25 ++ lib/kunit/Makefile | 4 ++ lib/kunit/example

[PATCH v17 05/19] kunit: test: add the concept of expectations

2019-09-20 Thread Brendan Higgins
Add support for expectations, which allow properties to be specified and then verified in tests. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- include/kunit/test.h | 836

Re: [PATCH v16 06/19] lib: enable building KUnit in lib/

2019-09-20 Thread Brendan Higgins
On Fri, Sep 20, 2019 at 4:44 PM Brendan Higgins wrote: > > On Fri, Sep 20, 2019 at 4:36 PM Stephen Boyd wrote: > > > > Quoting Brendan Higgins (2019-09-20 16:19:10) > > > KUnit is a new unit testing framework for the kernel and when used is > > > built into t

Re: [PATCH v16 06/19] lib: enable building KUnit in lib/

2019-09-20 Thread Brendan Higgins
On Fri, Sep 20, 2019 at 4:36 PM Stephen Boyd wrote: > > Quoting Brendan Higgins (2019-09-20 16:19:10) > > KUnit is a new unit testing framework for the kernel and when used is > > built into the kernel as a part of it. Add KUnit to the lib Kconfig and > > Makefile to allow

[PATCH v16 13/19] kunit: tool: add Python wrappers for running KUnit tests

2019-09-20 Thread Brendan Higgins
: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- tools/testing/kunit/.gitignore| 3 + tools/testing/kunit/kunit.py | 116 +++ tools/testing/kunit/kunit_config.py | 66 tools/testing/kunit

[PATCH v16 19/19] kunit: fix failure to build without printk

2019-09-20 Thread Brendan Higgins
Stephen Rothwell Cc: Sergey Senozhatsky Cc: Joe Perches Cc: tim.b...@sony.com Signed-off-by: Brendan Higgins Acked-by: Randy Dunlap # build-tested Reviewed-by: Petr Mladek --- include/kunit/test.h | 5 ++-- lib/kunit/test.c | 57 +--- 2 files changed,

[PATCH v16 17/19] kernel/sysctl-test: Add null pointer test for sysctl.c:proc_dointvec()

2019-09-20 Thread Brendan Higgins
From: Iurii Zaikin KUnit tests for initialized data behavior of proc_dointvec that is explicitly checked in the code. Includes basic parsing tests including int min/max overflow. Signed-off-by: Iurii Zaikin Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan

[PATCH v16 09/19] kunit: test: add support for test abort

2019-09-20 Thread Brendan Higgins
. Logically speaking, these are the premises of the test case, so if a premise isn't true, there is no point in continuing the test case because there are no conclusions that can be drawn without the premises. Whereas, the expectation is the thing you are trying to prove. Signed-off-by: Brendan Hi

[PATCH v16 14/19] kunit: defconfig: add defconfigs for building KUnit tests

2019-09-20 Thread Brendan Higgins
Add defconfig for UML and a fragment that can be used to configure other architectures for building KUnit tests. Add option to kunit_tool to use a defconfig to create the kunitconfig. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by

[PATCH v16 16/19] MAINTAINERS: add entry for KUnit the unit testing framework

2019-09-20 Thread Brendan Higgins
Add myself as maintainer of KUnit, the Linux kernel's unit testing framework. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- MAINTAINERS | 11 +++ 1 file changed, 11 insertions(+) diff --git a/MAINTAIN

[PATCH v16 15/19] Documentation: kunit: add documentation for KUnit

2019-09-20 Thread Brendan Higgins
Add documentation for KUnit, the Linux kernel unit testing framework. - Add intro and usage guide for KUnit - Add API reference Signed-off-by: Felix Guo Signed-off-by: Brendan Higgins Cc: Jonathan Corbet Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd

[PATCH v16 18/19] MAINTAINERS: add proc sysctl KUnit test to PROC SYSCTL section

2019-09-20 Thread Brendan Higgins
Add entry for the new proc sysctl KUnit test to the PROC SYSCTL section, and add Iurii as a maintainer. Signed-off-by: Brendan Higgins Cc: Iurii Zaikin Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Acked-by: Luis Chamberlain --- MAINTAINERS | 2 ++ 1 file changed, 2

[PATCH v16 12/19] kunit: test: add tests for KUnit managed resources

2019-09-20 Thread Brendan Higgins
: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- lib/kunit/test-test.c | 228 ++ 1 file changed, 228 insertions(+) diff --git a/lib/kunit/test-test.c b/lib/kunit/test-test.c index e0ab4bd546ea

[PATCH v16 10/19] kunit: test: add tests for kunit test abort

2019-09-20 Thread Brendan Higgins
Add KUnit tests for the KUnit test abort mechanism (see preceding commit). Add tests both for general try catch mechanism as well as non-architecture specific mechanism. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd

[PATCH v16 08/19] objtool: add kunit_try_catch_throw to the noreturn list

2019-09-20 Thread Brendan Higgins
kernel, to bail out of a broken test. As a consequence, it is a new __noreturn function that objtool thinks is broken (as seen above). So fix this warning by adding kunit_try_catch_throw to objtool's noreturn list. Reported-by: kbuild test robot Signed-off-by: Brendan Higgins Acked-by:

[PATCH v16 11/19] kunit: test: add the concept of assertions

2019-09-20 Thread Brendan Higgins
still express the idea of a premise using the above idiom, but I think KUNIT_ASSERT_* states the intended idea perfectly. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- include/kunit/test.h

[PATCH v16 07/19] kunit: test: add initial tests

2019-09-20 Thread Brendan Higgins
Add a test for string stream along with a simpler example. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- lib/kunit/Kconfig | 21 lib/kunit/Makefile | 4 ++ lib/kunit/example-test.c

[PATCH v16 01/19] kunit: test: add KUnit test runner core

2019-09-20 Thread Brendan Higgins
them test_modules). Just define test cases and how to execute them for now; setting expectations on code will be defined later. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Luis Chamberlain Reviewed-by: Stephen Boyd --- include/kunit

[PATCH v16 04/19] kunit: test: add assertion printing library

2019-09-20 Thread Brendan Higgins
Add `struct kunit_assert` and friends which provide a structured way to capture data from an expectation or an assertion (introduced later in the series) so that it may be printed out in the event of a failure. Signed-off-by: Brendan Higgins Reviewed-by: Stephen Boyd --- include/kunit/assert.h

[PATCH v16 06/19] lib: enable building KUnit in lib/

2019-09-20 Thread Brendan Higgins
KUnit is a new unit testing framework for the kernel and when used is built into the kernel as a part of it. Add KUnit to the lib Kconfig and Makefile to allow it to be actually built. Signed-off-by: Brendan Higgins Cc: Randy Dunlap Cc: Andrew Morton Cc: Masahiro Yamada Cc: Kees Cook

[PATCH v16 03/19] kunit: test: add string_stream a std::stream like string builder

2019-09-20 Thread Brendan Higgins
ilder, nothing more. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- include/kunit/string-stream.h | 51 lib/kunit/Makefile| 3 +- lib/kunit/string-stream.c | 217

[PATCH v16 05/19] kunit: test: add the concept of expectations

2019-09-20 Thread Brendan Higgins
Add support for expectations, which allow properties to be specified and then verified in tests. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- include/kunit/test.h | 836

[PATCH v16 00/19] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-09-20 Thread Brendan Higgins
uml-architectures [4] https://google.github.io/kunit-docs/third_party/kernel/docs/ [5] https://kunit.googlesource.com/linux/+/kunit/initial/v5.3/v16 --- Avinash Kondareddy (1): kunit: test: add tests for KUnit managed resources Brendan Higgins (16): kunit: test: add KUnit test runner core k

[PATCH v16 02/19] kunit: test: add test resource management API

2019-09-20 Thread Brendan Higgins
;test resources" which are managed by the test infrastructure and are automatically cleaned up at the conclusion of the test. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- include/kunit/te

[PATCH v15 07/18] kunit: test: add initial tests

2019-08-23 Thread Brendan Higgins
Add a test for string stream along with a simpler example. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- kunit/Kconfig | 21 + kunit/Makefile | 4 ++ kunit/example-test.c | 88

[PATCH v15 15/18] Documentation: kunit: add documentation for KUnit

2019-08-23 Thread Brendan Higgins
Add documentation for KUnit, the Linux kernel unit testing framework. - Add intro and usage guide for KUnit - Add API reference Signed-off-by: Felix Guo Signed-off-by: Brendan Higgins Cc: Jonathan Corbet Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd

[PATCH v15 11/18] kunit: test: add the concept of assertions

2019-08-23 Thread Brendan Higgins
still express the idea of a premise using the above idiom, but I think KUNIT_ASSERT_* states the intended idea perfectly. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- include/kunit/test.h

[PATCH v15 10/18] kunit: test: add tests for kunit test abort

2019-08-23 Thread Brendan Higgins
Add KUnit tests for the KUnit test abort mechanism (see preceding commit). Add tests both for general try catch mechanism as well as non-architecture specific mechanism. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd

[PATCH v15 16/18] MAINTAINERS: add entry for KUnit the unit testing framework

2019-08-23 Thread Brendan Higgins
Add myself as maintainer of KUnit, the Linux kernel's unit testing framework. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- MAINTAINERS | 11 +++ 1 file changed, 11 insertions(+) diff --git a/MAINTAIN

[PATCH v15 09/18] kunit: test: add support for test abort

2019-08-23 Thread Brendan Higgins
. Logically speaking, these are the premises of the test case, so if a premise isn't true, there is no point in continuing the test case because there are no conclusions that can be drawn without the premises. Whereas, the expectation is the thing you are trying to prove. Signed-off-by: Brendan Hi

[PATCH v15 17/18] kernel/sysctl-test: Add null pointer test for sysctl.c:proc_dointvec()

2019-08-23 Thread Brendan Higgins
From: Iurii Zaikin KUnit tests for initialized data behavior of proc_dointvec that is explicitly checked in the code. Includes basic parsing tests including int min/max overflow. Signed-off-by: Iurii Zaikin Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan

[PATCH v15 12/18] kunit: test: add tests for KUnit managed resources

2019-08-23 Thread Brendan Higgins
: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- kunit/test-test.c | 228 ++ 1 file changed, 228 insertions(+) diff --git a/kunit/test-test.c b/kunit/test-test.c index e0ab4bd546ea

[PATCH v15 14/18] kunit: defconfig: add defconfigs for building KUnit tests

2019-08-23 Thread Brendan Higgins
Add defconfig for UML and a fragment that can be used to configure other architectures for building KUnit tests. Add option to kunit_tool to use a defconfig to create the kunitconfig. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by

[PATCH v15 18/18] MAINTAINERS: add proc sysctl KUnit test to PROC SYSCTL section

2019-08-23 Thread Brendan Higgins
Add entry for the new proc sysctl KUnit test to the PROC SYSCTL section, and add Iurii as a maintainer. Signed-off-by: Brendan Higgins Cc: Iurii Zaikin Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Acked-by: Luis Chamberlain --- MAINTAINERS | 2 ++ 1 file changed, 2

[PATCH v15 13/18] kunit: tool: add Python wrappers for running KUnit tests

2019-08-23 Thread Brendan Higgins
: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- tools/testing/kunit/.gitignore| 3 + tools/testing/kunit/kunit.py | 116 +++ tools/testing/kunit/kunit_config.py | 66 tools/testing/kunit

[PATCH v15 08/18] objtool: add kunit_try_catch_throw to the noreturn list

2019-08-23 Thread Brendan Higgins
kernel, to bail out of a broken test. As a consequence, it is a new __noreturn function that objtool thinks is broken (as seen above). So fix this warning by adding kunit_try_catch_throw to objtool's noreturn list. Reported-by: kbuild test robot Signed-off-by: Brendan Higgins Acked-by:

[PATCH v15 04/18] kunit: test: add assertion printing library

2019-08-23 Thread Brendan Higgins
Add `struct kunit_assert` and friends which provide a structured way to capture data from an expectation or an assertion (introduced later in the series) so that it may be printed out in the event of a failure. Signed-off-by: Brendan Higgins Reviewed-by: Stephen Boyd --- include/kunit/assert.h

[PATCH v15 03/18] kunit: test: add string_stream a std::stream like string builder

2019-08-23 Thread Brendan Higgins
ilder, nothing more. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- include/kunit/string-stream.h | 51 kunit/Makefile| 3 +- kunit/string-stream.c | 217

[PATCH v15 05/18] kunit: test: add the concept of expectations

2019-08-23 Thread Brendan Higgins
Add support for expectations, which allow properties to be specified and then verified in tests. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- include/kunit/test.h | 836

[PATCH v15 02/18] kunit: test: add test resource management API

2019-08-23 Thread Brendan Higgins
;test resources" which are managed by the test infrastructure and are automatically cleaned up at the conclusion of the test. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- include/kunit/te

[PATCH v15 06/18] kbuild: enable building KUnit

2019-08-23 Thread Brendan Higgins
KUnit is a new unit testing framework for the kernel and when used is built into the kernel as a part of it. Add KUnit to the root Kconfig and Makefile to allow it to be actually built. Signed-off-by: Brendan Higgins Acked-by: Masahiro Yamada Cc: Michal Marek Reviewed-by: Greg Kroah-Hartman

[PATCH v15 00/18] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-08-23 Thread Brendan Higgins
## TL;DR This revision addresses comments from Shuah by fixing a couple checkpatch warnings and fixing some comment readability issues. No API or major structual changes have been made since v13. ## Background This patch set proposes KUnit, a lightweight unit testing and mocking framework for th

[PATCH v15 01/18] kunit: test: add KUnit test runner core

2019-08-23 Thread Brendan Higgins
them test_modules). Just define test cases and how to execute them for now; setting expectations on code will be defined later. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Luis Chamberlain Reviewed-by: Stephen Boyd --- include/kunit

Re: [PATCH v14 01/18] kunit: test: add KUnit test runner core

2019-08-23 Thread Brendan Higgins
On Fri, Aug 23, 2019 at 12:04 PM shuah wrote: > > On 8/23/19 12:56 PM, Brendan Higgins wrote: > > On Fri, Aug 23, 2019 at 11:32 AM shuah wrote: > >> > >> On 8/23/19 11:54 AM, Brendan Higgins wrote: > >>> On Fri, Aug 23, 2019 at 10:34 AM shuah wrote:

Re: [PATCH v14 01/18] kunit: test: add KUnit test runner core

2019-08-23 Thread Brendan Higgins
On Fri, Aug 23, 2019 at 11:32 AM shuah wrote: > > On 8/23/19 11:54 AM, Brendan Higgins wrote: > > On Fri, Aug 23, 2019 at 10:34 AM shuah wrote: > >> > >> On 8/23/19 11:27 AM, Brendan Higgins wrote: > >>> On Fri, Aug 23, 2019 at 10:05 AM shuah wrote:

Re: [PATCH v14 01/18] kunit: test: add KUnit test runner core

2019-08-23 Thread Brendan Higgins
On Fri, Aug 23, 2019 at 10:34 AM shuah wrote: > > On 8/23/19 11:27 AM, Brendan Higgins wrote: > > On Fri, Aug 23, 2019 at 10:05 AM shuah wrote: > >> > >> On 8/23/19 10:48 AM, Brendan Higgins wrote: > >>> On Fri, Aug 23, 2019 at 8:33 AM shuah wrote: &g

Re: [PATCH v14 09/18] kunit: test: add support for test abort

2019-08-23 Thread Brendan Higgins
On Fri, Aug 23, 2019 at 10:07 AM shuah wrote: > > On 8/23/19 10:56 AM, Brendan Higgins wrote: > > On Fri, Aug 23, 2019 at 8:36 AM shuah wrote: > >> > >> Hi Brendan, > >> > >> On 8/20/19 5:20 PM, Brendan Higgins wrote: > >>> Add support

Re: [PATCH v14 01/18] kunit: test: add KUnit test runner core

2019-08-23 Thread Brendan Higgins
On Fri, Aug 23, 2019 at 10:05 AM shuah wrote: > > On 8/23/19 10:48 AM, Brendan Higgins wrote: > > On Fri, Aug 23, 2019 at 8:33 AM shuah wrote: > >> > >> Hi Brendan, > >> > >> On 8/20/19 5:20 PM, Brendan Higgins wrote: > >>> Add core fa

Re: [PATCH v14 09/18] kunit: test: add support for test abort

2019-08-23 Thread Brendan Higgins
On Fri, Aug 23, 2019 at 8:36 AM shuah wrote: > > Hi Brendan, > > On 8/20/19 5:20 PM, Brendan Higgins wrote: > > Add support for aborting/bailing out of test cases, which is needed for > > implementing assertions. > > > > An assertion is like an expecta

Re: [PATCH v14 01/18] kunit: test: add KUnit test runner core

2019-08-23 Thread Brendan Higgins
On Fri, Aug 23, 2019 at 8:33 AM shuah wrote: > > Hi Brendan, > > On 8/20/19 5:20 PM, Brendan Higgins wrote: > > Add core facilities for defining unit tests; this provides a common way > > to define test cases, functions that execute code which is under test > >

Re: [PATCH v13 00/18] kunit: introduce KUnit, the Linux kernel unit testing framework

2019-08-20 Thread Brendan Higgins
On Tue, Aug 20, 2019 at 2:26 PM Brendan Higgins wrote: > > On Tue, Aug 20, 2019 at 12:08 PM shuah wrote: > > > > On 8/20/19 12:24 PM, Brendan Higgins wrote: > > > On Tue, Aug 20, 2019 at 11:24:45AM -0600, shuah wrote: > > >> On 8/13/19 11:50 PM,

[PATCH v14 11/18] kunit: test: add the concept of assertions

2019-08-20 Thread Brendan Higgins
still express the idea of a premise using the above idiom, but I think KUNIT_ASSERT_* states the intended idea perfectly. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd --- include/kunit/test.h

[PATCH v14 10/18] kunit: test: add tests for kunit test abort

2019-08-20 Thread Brendan Higgins
Add KUnit tests for the KUnit test abort mechanism (see preceding commit). Add tests both for general try catch mechanism as well as non-architecture specific mechanism. Signed-off-by: Brendan Higgins Reviewed-by: Greg Kroah-Hartman Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd

  1   2   3   4   5   6   >