From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brendan Higgins Subject: Re: [RFC v2 01/14] kunit: test: add KUnit test runner core Date: Tue, 6 Nov 2018 17:28:43 -0800 Message-ID: References: <20181023235750.103146-1-brendanhiggins@google.com> <20181023235750.103146-2-brendanhiggins@google.com> <017b111f-d960-c1ef-46ae-eb0eb639fe5b@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <017b111f-d960-c1ef-46ae-eb0eb639fe5b-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org Sender: "Linux-nvdimm" To: shuah-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org Cc: brakmo-b10kYP2dOMg@public.gmane.org, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, linux-kselftest-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Rob Herring , linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org, richard-/L3Ra7n9ekc@public.gmane.org, kieran.bingham-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org, Joel Stanley , jdike-OPE4K8JWMJJBDgjK7y7TUQ@public.gmane.org, Tim.Bird-7U/KSKJipcs@public.gmane.org, Kees Cook , linux-um-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, rostedt-nx8X9YLhiw1AfugRpC6u6w@public.gmane.org, Julia Lawall , kunit-dev-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org, Greg KH , Linux Kernel Mailing List , mcgrof-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Daniel Vetter , mpe-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org, joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org, khilman-rdvid1DuHRBWk0Htik3J/w@public.gmane.org List-Id: linux-nvdimm@lists.01.org On Fri, Nov 2, 2018 at 11:44 AM Shuah Khan wrote: > > On 10/23/2018 05:57 PM, Brendan Higgins wrote: > > + * Example: > > + * > > + * .. code-block:: c > > + * > > + * void add_test_basic(struct test *test) > > + * { > > + * TEST_EXPECT_EQ(test, 1, add(1, 0)); > > + * TEST_EXPECT_EQ(test, 2, add(1, 1)); > > + * TEST_EXPECT_EQ(test, 0, add(-1, 1)); > > + * TEST_EXPECT_EQ(test, INT_MAX, add(0, INT_MAX)); > > + * TEST_EXPECT_EQ(test, -1, add(INT_MAX, INT_MIN)); > > + * } > > + * > > + * static struct test_case example_test_cases[] = { > > + * TEST_CASE(add_test_basic), > > + * {}, > > + * }; > > + * > > + */ > > +struct test_case { > > + void (*run_case)(struct test *test); > > + const char name[256]; > > + > > + /* private: internal use only. */ > > + bool success; > > +}; > > + > > Introducing a prefix kunit_* might be a good idea for the API. > This comment applies to the rest of patches as well. What about kunit_* instead of test_* and kmock_* instead of mock_*? Does that seem reasonable?