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

2019-09-23 Thread Stephen Boyd
Randy Dunlap > Cc: Andrew Morton > Cc: Masahiro Yamada > Cc: Kees Cook > --- Reviewed-by: Stephen Boyd ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

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

2019-09-20 Thread Stephen Boyd
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 it to be actually built. > > Signed-off-by: Brendan Higgins > Cc: Randy Dunlap >

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

2019-08-14 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-14 03:03:47) > On Tue, Aug 13, 2019 at 10:52 PM Brendan Higgins > wrote: > > > > ## TL;DR > > > > This revision addresses comments from Stephen and Bjorn Helgaas. Most > > changes are pretty minor stuff that doesn't affect the API in anyway. > > One significant

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

2019-08-14 Thread Stephen Boyd
wed-by: Greg Kroah-Hartman > Reviewed-by: Logan Gunthorpe > --- Reviewed-by: Stephen Boyd ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

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

2019-08-14 Thread Stephen Boyd
devm_* managed > resources. > > Signed-off-by: Avinash Kondareddy > Signed-off-by: Brendan Higgins > Reviewed-by: Greg Kroah-Hartman > Reviewed-by: Logan Gunthorpe > --- Reviewed-by: Stephen Boyd ___ Linux-nvdimm mailing list Linux-

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

2019-08-14 Thread Stephen Boyd
to > C++'s std::string. string_stream is really just a string builder, > nothing more. > > Signed-off-by: Brendan Higgins > Reviewed-by: Greg Kroah-Hartman > Reviewed-by: Logan Gunthorpe > --- Reviewed-by: Stephen Boyd The spinlocks will probably need to change to be ir

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

2019-08-13 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-13 00:52:03) > On Mon, Aug 12, 2019 at 10:56 PM Stephen Boyd wrote: > > > > Quoting Brendan Higgins (2019-08-12 21:57:55) > > > On Mon, Aug 12, 2019 at 9:22 PM Stephen Boyd wrote: > > > > > > > > Quoting Brendan Hi

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

2019-08-13 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-13 00:57:33) > On Mon, Aug 12, 2019 at 9:31 PM Stephen Boyd wrote: > > > > BTW, maybe kunit allocation APIs should > > fail the test if they fail to allocate in general. Unless we're unit > > testing failure to allocate problems. > &

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

2019-08-13 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-13 02:12:54) > On Tue, Aug 13, 2019 at 2:04 AM Brendan Higgins > wrote: > > > > On Mon, Aug 12, 2019 at 10:30 PM Stephen Boyd wrote: > > > > > > Quoting Brendan Higgins (2019-08-12 22:02:59) > > > > However, now th

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

2019-08-13 Thread Stephen Boyd
user friendly way. > > test_data/*: samples of test data for testing kunit.py, kunit_config.py, > etc. > > Signed-off-by: Felix Guo > Signed-off-by: Brendan Higgins > Reviewed-by: Greg Kroah-Hartman > Reviewed-by: Logan Gunthorpe > --- Reviewed-by:

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

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 22:06:04) > On Mon, Aug 12, 2019 at 9:24 PM Stephen Boyd wrote: > > > > Quoting Brendan Higgins (2019-08-12 11:24:13) > > > + > > > +static int kunit_try_catch_test_init(struct kunit *test) > > > +{ > > &g

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

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 21:57:55) > On Mon, Aug 12, 2019 at 9:22 PM Stephen Boyd wrote: > > > > Quoting Brendan Higgins (2019-08-12 11:24:12) > > > diff --git a/include/kunit/test.h b/include/kunit/test.h > > > index 2625bcfeb19ac..93381f841e09f 100644

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

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 22:02:59) > On Mon, Aug 12, 2019 at 9:56 PM Stephen Boyd wrote: > > > > Quoting Brendan Higgins (2019-08-12 17:41:05) > > > On Mon, Aug 12, 2019 at 4:59 PM Stephen Boyd wrote: > > > > > > > > > kunit_res

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

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 11:24:19) > 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 > --- Revi

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

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 17:33:52) > On Mon, Aug 12, 2019 at 04:57:00PM -0700, Stephen Boyd wrote: > > Quoting Brendan Higgins (2019-08-12 11:24:08) > > > + */ > > > +#define KUNIT_EXPECT_TRUE(test, condition) \ > > > + KUNIT_TR

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

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 21:27:05) > On Mon, Aug 12, 2019 at 4:56 PM Brendan Higgins > wrote: > > > > On Mon, Aug 12, 2019 at 4:46 PM Stephen Boyd wrote: > > > > > > Quoting Brendan Higgins (2019-08-12 11:24:07) > > > > +

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

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 17:41:05) > On Mon, Aug 12, 2019 at 4:59 PM Stephen Boyd wrote: > > > > > kunit_resource_destroy (respective equivalents to devm_kfree, and > > > devres_destroy) and use kunit_kfree here? > > > > > > > Y

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

2019-08-12 Thread Stephen Boyd
an > Reviewed-by: Logan Gunthorpe Reviewed-by: Stephen Boyd > + * Sets an expectation that the values that @left and @right evaluate to are > + * not equal. This is semantically equivalent to > + * KUNIT_ASSERT_TRUE(@test, strcmp((@left), (@right))). See > KUNIT_ASSERT_TRUE() >

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

2019-08-12 Thread Stephen Boyd
; Signed-off-by: Brendan Higgins > Reviewed-by: Greg Kroah-Hartman > Reviewed-by: Logan Gunthorpe > Acked-by: Luis Chamberlain > --- Reviewed-by: Stephen Boyd ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

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

2019-08-12 Thread Stephen Boyd
Reviewed-by: Greg Kroah-Hartman > Reviewed-by: Logan Gunthorpe > --- Reviewed-by: Stephen Boyd ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

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

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 11:24:17) > diff --git a/arch/um/configs/kunit_defconfig b/arch/um/configs/kunit_defconfig > new file mode 100644 > index 0..bfe49689038f1 > --- /dev/null > +++ b/arch/um/configs/kunit_defconfig > @@ -0,0 +1,8 @@ > +CONFIG_OF=y >

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

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 11:24:15) > + > +static int kunit_resource_test_init(struct kunit *test) > +{ > + struct kunit_test_resource_context *ctx = > + kzalloc(sizeof(*ctx), GFP_KERNEL); > + > + if (!ctx) > + return -ENOMEM; Should this

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

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 11:24:13) > + > +static int kunit_try_catch_test_init(struct kunit *test) > +{ > + struct kunit_try_catch_test_context *ctx; > + > + ctx = kunit_kzalloc(test, sizeof(*ctx), GFP_KERNEL); Can this fail? Should return -ENOMEM in that case? > +

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

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 11:24:12) > diff --git a/include/kunit/test.h b/include/kunit/test.h > index 2625bcfeb19ac..93381f841e09f 100644 > --- a/include/kunit/test.h > +++ b/include/kunit/test.h > @@ -13,6 +13,7 @@ > #include > #include > #include > +#include > > struct

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

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 11:24:10) > 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 > --- Reviewe

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

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 11:24:08) > 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

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

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 16:33:36) > On Mon, Aug 12, 2019 at 03:55:19PM -0700, Stephen Boyd wrote: > > Quoting Brendan Higgins (2019-08-12 11:24:06) > > > +void string_stream_clear(struct string_stream *stream) > > > +{ > > > + struct st

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

2019-08-12 Thread Stephen Boyd
Brendan Higgins > --- Reviewed-by: Stephen Boyd Just some minor nits below > diff --git a/include/kunit/assert.h b/include/kunit/assert.h > new file mode 100644 > index 0..55f1b88b0cb4d > --- /dev/null > +++ b/include/kunit/assert.h > @@ -0,0 +1,183 @@ [...]

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

2019-08-12 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-12 11:24:06) > +void string_stream_clear(struct string_stream *stream) > +{ > + struct string_stream_fragment *frag_container, *frag_container_safe; > + > + spin_lock(>lock); > + list_for_each_entry_safe(frag_container, > +

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

2019-08-12 Thread Stephen Boyd
wed-by: Logan Gunthorpe > --- Reviewed-by: Stephen Boyd ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH v9 04/18] kunit: test: add kunit_stream a std::stream like logger

2019-08-01 Thread Stephen Boyd
Quoting Brendan Higgins (2019-08-01 11:59:57) > On Thu, Aug 1, 2019 at 11:55 AM Brendan Higgins > wrote: > > > > On Fri, Jul 26, 2019 at 1:31 AM Petr Mladek wrote: > > > > > To be honest I do not fully understand KUnit design. I am not > > > completely sure how the tested code is isolated from

Re: [PATCH v9 04/18] kunit: test: add kunit_stream a std::stream like logger

2019-07-22 Thread Stephen Boyd
Quoting Brendan Higgins (2019-07-22 15:30:49) > On Mon, Jul 22, 2019 at 1:03 PM Stephen Boyd wrote: > > > > > > What's the calling context of the assertions and expectations? I still > > don't like the fact that string stream needs to allocate buffers and > >

Re: [PATCH v9 04/18] kunit: test: add kunit_stream a std::stream like logger

2019-07-22 Thread Stephen Boyd
Quoting Brendan Higgins (2019-07-18 17:08:34) > On Thu, Jul 18, 2019 at 12:22:33PM -0700, Brendan Higgins wrote: > > I started poking around with your suggestion while we are waiting. A > couple early observations: > > 1) It is actually easier to do than I previously thought and will probably >

Re: [PATCH v9 04/18] kunit: test: add kunit_stream a std::stream like logger

2019-07-18 Thread Stephen Boyd
Quoting Brendan Higgins (2019-07-16 11:52:01) > On Tue, Jul 16, 2019 at 10:50 AM Stephen Boyd wrote: > > > > > The only hypothetical case where this can't be done is a complicated > > assertion or expectation that does more than one check and can't be > > writte

Re: [PATCH v9 04/18] kunit: test: add kunit_stream a std::stream like logger

2019-07-16 Thread Stephen Boyd
Quoting Brendan Higgins (2019-07-16 01:37:34) > On Tue, Jul 16, 2019 at 12:57 AM Brendan Higgins > wrote: > > > > A `struct kunit_stream` is usually associated with a message that is > > being built up over time like maybe an expectation; it is meant to > > capture the idea that we might want to

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

2019-07-16 Thread Stephen Boyd
Quoting Brendan Higgins (2019-07-15 15:43:20) > On Mon, Jul 15, 2019 at 3:11 PM Brendan Higgins > wrote: > > > > On Mon, Jul 15, 2019 at 3:04 PM Stephen Boyd wrote: > > > > > > Quoting Brendan Higgins (2019-07-15 14:11:50) > > > > On

Re: [PATCH v9 04/18] kunit: test: add kunit_stream a std::stream like logger

2019-07-16 Thread Stephen Boyd
Quoting Brendan Higgins (2019-07-16 01:37:34) > On Tue, Jul 16, 2019 at 12:57 AM Brendan Higgins > wrote: > > > > On Mon, Jul 15, 2019 at 3:15 PM Stephen Boyd wrote: > > > > > > Quoting Brendan Higgins (2019-07-12 01:17:30) > > > > diff --git a/in

Re: [PATCH v9 04/18] kunit: test: add kunit_stream a std::stream like logger

2019-07-15 Thread Stephen Boyd
Quoting Brendan Higgins (2019-07-12 01:17:30) > diff --git a/include/kunit/kunit-stream.h b/include/kunit/kunit-stream.h > new file mode 100644 > index 0..a7b53eabf6be4 > --- /dev/null > +++ b/include/kunit/kunit-stream.h > @@ -0,0 +1,81 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ >

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

2019-07-15 Thread Stephen Boyd
Quoting Brendan Higgins (2019-07-15 14:11:50) > On Mon, Jul 15, 2019 at 1:43 PM Stephen Boyd wrote: > > > > I also wonder if it would be better to just have a big slop buffer of a > > 4K page or something so that we almost never have to allocate anything > > with a st

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

2019-07-15 Thread Stephen Boyd
Quoting Brendan Higgins (2019-07-15 13:30:22) > On Mon, Jul 15, 2019 at 1:24 PM Stephen Boyd wrote: > > > > Quoting Brendan Higgins (2019-07-12 01:17:28) > > > diff --git a/kunit/test.c b/kunit/test.c > > > index 571e4c65deb5c..f165c9d8e10b0 100644 > > >

Re: [PATCH v9 06/18] kbuild: enable building KUnit

2019-07-15 Thread Stephen Boyd
Acked-by: Masahiro Yamada > Cc: Michal Marek > Reviewed-by: Greg Kroah-Hartman > Reviewed-by: Logan Gunthorpe > --- Reviewed-by: Stephen Boyd ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

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

2019-07-15 Thread Stephen Boyd
Quoting Brendan Higgins (2019-07-12 01:17:29) > diff --git a/include/kunit/string-stream.h b/include/kunit/string-stream.h > new file mode 100644 > index 0..0552a05781afe > --- /dev/null > +++ b/include/kunit/string-stream.h > @@ -0,0 +1,49 @@ > +/* SPDX-License-Identifier: GPL-2.0 */

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

2019-07-15 Thread Stephen Boyd
Quoting Brendan Higgins (2019-07-12 01:17:28) > diff --git a/kunit/test.c b/kunit/test.c > index 571e4c65deb5c..f165c9d8e10b0 100644 > --- a/kunit/test.c > +++ b/kunit/test.c > @@ -171,6 +175,96 @@ int kunit_run_tests(struct kunit_suite *suite) > return 0; > } > > +struct kunit_resource

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

2019-07-15 Thread Stephen Boyd
n > Reviewed-by: Logan Gunthorpe > Reviewed-by: Luis Chamberlain Reviewed-by: Stephen Boyd Minor nits below. > diff --git a/kunit/test.c b/kunit/test.c > new file mode 100644 > index 0..571e4c65deb5c > --- /dev/null > +++ b/kunit/test.c > @@ -0,0 +1,189 @@ > +//

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

2019-06-27 Thread Stephen Boyd
Quoting Brendan Higgins (2019-06-26 16:00:40) > On Tue, Jun 25, 2019 at 8:41 PM Stephen Boyd wrote: > > > scenario like below, but where it is a problem. There could be three > > CPUs, or even one CPU and three threads if you want to describe the > > extra thread sce

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

2019-06-25 Thread Stephen Boyd
Quoting Brendan Higgins (2019-06-25 13:28:25) > On Wed, Jun 19, 2019 at 5:15 PM Stephen Boyd wrote: > > > > Quoting Brendan Higgins (2019-06-17 01:25:56) > > > diff --git a/kunit/test.c b/kunit/test.c > > > new file mode 100644 > > > index 00

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

2019-06-11 Thread Stephen Boyd
Quoting Brendan Higgins (2019-06-11 10:58:30) > On Fri, Jun 07, 2019 at 12:00:47PM -0700, Stephen Boyd wrote: > > Quoting Iurii Zaikin (2019-06-05 18:29:42) > > > On Fri, May 17, 2019 at 11:22 AM Stephen Boyd wrote: > > > > > > > > Quoting Brendan Hi

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

2019-05-17 Thread Stephen Boyd
Quoting Brendan Higgins (2019-05-14 15:16:54) > diff --git a/include/kunit/test.h b/include/kunit/test.h > new file mode 100644 > index 0..e682ea0e1f9a5 > --- /dev/null > +++ b/include/kunit/test.h > @@ -0,0 +1,162 @@ > +/* SPDX-License-Identifier: GPL-2.0 */ > +/* > + * Base unit test

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

2019-05-17 Thread Stephen Boyd
Quoting Brendan Higgins (2019-05-14 15:17:10) > diff --git a/kernel/sysctl-test.c b/kernel/sysctl-test.c > new file mode 100644 > index 0..fe0f2bae66085 > --- /dev/null > +++ b/kernel/sysctl-test.c > @@ -0,0 +1,293 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * KUnit test of

Re: [PATCH v4 04/18] kunit: test: add kunit_stream a std::stream like logger

2019-05-17 Thread Stephen Boyd
Quoting Brendan Higgins (2019-05-14 15:16:57) > diff --git a/kunit/kunit-stream.c b/kunit/kunit-stream.c > new file mode 100644 > index 0..1884f1b550888 > --- /dev/null > +++ b/kunit/kunit-stream.c > @@ -0,0 +1,152 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * C++ stream style

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

2019-05-17 Thread Stephen Boyd
Quoting Brendan Higgins (2019-05-14 15:16:56) > A number of test features need to do pretty complicated string printing > where it may not be possible to rely on a single preallocated string > with parameters. > > So provide a library for constructing the string as you go similar to > C++'s

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

2019-05-16 Thread Stephen Boyd
Quoting Brendan Higgins (2019-05-14 15:16:55) > diff --git a/kunit/test.c b/kunit/test.c > index 86f65ba2bcf92..a15e6f8c41582 100644 > --- a/kunit/test.c > +++ b/kunit/test.c [..] > + > +void *kunit_kmalloc(struct kunit *test, size_t size, gfp_t gfp) > +{ > + struct kunit_kmalloc_params

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

2019-05-16 Thread Stephen Boyd
Quoting Brendan Higgins (2019-05-14 15:16:54) > diff --git a/include/kunit/test.h b/include/kunit/test.h > new file mode 100644 > index 0..e682ea0e1f9a5 > --- /dev/null > +++ b/include/kunit/test.h > @@ -0,0 +1,162 @@ [..] > +/** > + * struct kunit - represents a running instance of a

Re: [RFC v4 08/17] kunit: test: add support for test abort

2019-02-28 Thread Stephen Boyd
Quoting Brendan Higgins (2019-02-28 01:03:24) > On Tue, Feb 26, 2019 at 12:35 PM Stephen Boyd wrote: > > > > when they need to abort and then the test runner would detect that error > > via the return value from the 'run test' function. That would be a more > > dir

Re: [RFC v4 08/17] kunit: test: add support for test abort

2019-02-26 Thread Stephen Boyd
Quoting Brendan Higgins (2019-02-14 13:37:20) > Add support for aborting/bailing out of test cases. Needed for > implementing assertions. Can you add some more text here with the motivating reasons for implementing assertions and bailing out of test cases? For example, I wonder why unit tests

Re: [RFC v4 10/17] kunit: test: add test managed resource tests

2019-02-20 Thread Stephen Boyd
Quoting Brendan Higgins (2019-02-19 15:20:18) > On Fri, Feb 15, 2019 at 12:54 PM Stephen Boyd wrote: > > > > Quoting Brendan Higgins (2019-02-14 13:37:22) > > > + > > > +static struct kunit_case kunit_resource_test_cases[] = { > > > > Can these arrays

Re: [RFC v4 02/17] kunit: test: add test resource management API

2019-02-15 Thread Stephen Boyd
Quoting Brendan Higgins (2019-02-14 13:37:14) > @@ -104,6 +167,7 @@ struct kunit { > const char *name; /* Read only after initialization! */ > spinlock_t lock; /* Gaurds all mutable test state. */ > bool success; /* Protected by lock. */ > + struct list_head

Re: [RFC v4 10/17] kunit: test: add test managed resource tests

2019-02-15 Thread Stephen Boyd
Quoting Brendan Higgins (2019-02-14 13:37:22) > diff --git a/kunit/test-test.c b/kunit/test-test.c > index 0b4ad6690310d..bb34431398526 100644 > --- a/kunit/test-test.c > +++ b/kunit/test-test.c [...] > + > +#define KUNIT_RESOURCE_NUM 5 > +static void kunit_resource_test_cleanup_resources(struct