devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: shuah <shuah-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Brendan Higgins <brendanhiggins-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: Petr Mladek <pmladek-IBi9RG/b67k@public.gmane.org>,
	"open list:DOCUMENTATION"
	<linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Amir Goldstein <amir73il-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	dri-devel
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	Sasha Levin
	<Alexander.Levin-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>,
	Masahiro Yamada
	<yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>,
	"open list:KERNEL SELFTEST FRAMEWORK"
	<linux-kselftest-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Frank Rowand
	<frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-nvdimm
	<linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org>,
	Kevin Hilman <khilman-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>,
	Knut Omang <knut.omang-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	Kieran Bingham
	<kieran.bingham-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>,
	wfg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org,
	Joel Stanley <joel-U3u1mxZcP9KHXe+LvDLADg@public.gmane.org>,
	David Rientjes <rientjes-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Jeff Dike <jdike-OPE4K8JWMJJBDgjK7y7TUQ@public.gmane.org>,
	Dan Carpenter
	<dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	shuah <shuah-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-kbuild
	<linux-kbuild-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v14 01/18] kunit: test: add KUnit test runner core
Date: Fri, 23 Aug 2019 11:05:35 -0600	[thread overview]
Message-ID: <4513d9f3-a69b-a9a4-768b-86c2962b62e0@kernel.org> (raw)
In-Reply-To: <CAFd5g44mRK9t4f58i_YMEt=e9RTxwrrhFY_V2LW_E7bUwR3cdg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 8/23/19 10:48 AM, Brendan Higgins wrote:
> On Fri, Aug 23, 2019 at 8:33 AM shuah <shuah-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> 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
>>> and determine whether the code under test behaves as expected; this also
>>> provides a way to group together related test cases in test suites (here
>>> we call 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 <brendanhiggins-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
>>> Reviewed-by: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
>>> Reviewed-by: Logan Gunthorpe <logang-OTvnGxWRz7hWk0Htik3J/w@public.gmane.org>
>>> Reviewed-by: Luis Chamberlain <mcgrof-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>>> Reviewed-by: Stephen Boyd <sboyd-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>>> ---
>>>    include/kunit/test.h | 179 ++++++++++++++++++++++++++++++++++++++++
>>>    kunit/Kconfig        |  17 ++++
>>>    kunit/Makefile       |   1 +
>>>    kunit/test.c         | 191 +++++++++++++++++++++++++++++++++++++++++++
>>>    4 files changed, 388 insertions(+)
>>>    create mode 100644 include/kunit/test.h
>>>    create mode 100644 kunit/Kconfig
>>>    create mode 100644 kunit/Makefile
>>>    create mode 100644 kunit/test.c
>>>
>>> diff --git a/include/kunit/test.h b/include/kunit/test.h
>>> new file mode 100644
>>> index 0000000000000..e0b34acb9ee4e
>>> --- /dev/null
>>> +++ b/include/kunit/test.h
>>> @@ -0,0 +1,179 @@
>>> +/* SPDX-License-Identifier: GPL-2.0 */
>>> +/*
>>> + * Base unit test (KUnit) API.
>>> + *
>>> + * Copyright (C) 2019, Google LLC.
>>> + * Author: Brendan Higgins <brendanhiggins-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
>>> + */
>>> +
>>> +#ifndef _KUNIT_TEST_H
>>> +#define _KUNIT_TEST_H
>>> +
>>> +#include <linux/types.h>
>>> +
>>> +struct kunit;
>>> +
>>> +/**
>>> + * struct kunit_case - represents an individual test case.
>>> + * @run_case: the function representing the actual test case.
>>> + * @name: the name of the test case.
>>> + *
>>> + * A test case is a function with the signature, ``void (*)(struct kunit *)``
>>> + * that makes expectations (see KUNIT_EXPECT_TRUE()) about code under test. Each
>>> + * test case is associated with a &struct kunit_suite and will be run after the
>>> + * suite's init function and followed by the suite's exit function.
>>> + *
>>> + * A test case should be static and should only be created with the KUNIT_CASE()
>>> + * macro; additionally, every array of test cases should be terminated with an
>>> + * empty test case.
>>> + *
>>> + * Example:
>>
>> Can you fix these line continuations. It makes it very hard to read.
>> Sorry for this late comment. These comments lines are longer than 80
>> and wrap.
> 
> None of the lines in this commit are over 80 characters in column
> width. Some are exactly 80 characters (like above).
> 
> My guess is that you are seeing the diff added text (+ ), which when
> you add that to a line which is exactly 80 char in length ends up
> being over 80 char in email. If you apply the patch you will see that
> they are only 80 chars.
> 
>>
>> There are several comment lines in the file that are way too long.
> 
> Note that checkpatch also does not complain about any over 80 char
> lines in this file.
> 
> Sorry if I am misunderstanding what you are trying to tell me. Please
> confirm either way.
> 

WARNING: Avoid unnecessary line continuations
#258: FILE: include/kunit/test.h:137:
+		 */							       \

total: 0 errors, 2 warnings, 388 lines checked

Go ahead fix these. It appears there are few lines that either longer
than 80. In general, I keep them around 75, so it is easier read.

thanks,
-- Shuah

  parent reply	other threads:[~2019-08-23 17:05 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 23:20 [PATCH v14 00/18] kunit: introduce KUnit, the Linux kernel unit testing framework Brendan Higgins
2019-08-20 23:20 ` [PATCH v14 01/18] kunit: test: add KUnit test runner core Brendan Higgins
2019-08-23 15:33   ` shuah
2019-08-23 16:48     ` Brendan Higgins
     [not found]       ` <CAFd5g44mRK9t4f58i_YMEt=e9RTxwrrhFY_V2LW_E7bUwR3cdg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-08-23 17:05         ` shuah [this message]
     [not found]           ` <4513d9f3-a69b-a9a4-768b-86c2962b62e0-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2019-08-23 17:27             ` Brendan Higgins
2019-08-23 17:34               ` shuah
2019-08-23 17:54                 ` Brendan Higgins
     [not found]                   ` <CAFd5g44hLgeqPtNw1zQ5k_+apBm=ri_6=wAgHk=oPOvQs6xgNg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-08-23 18:32                     ` shuah
2019-08-23 18:56                       ` Brendan Higgins
2019-08-23 19:04                         ` shuah
2019-08-23 19:20                           ` Brendan Higgins
2019-08-23 19:43                             ` shuah
2019-08-20 23:20 ` [PATCH v14 02/18] kunit: test: add test resource management API Brendan Higgins
2019-08-20 23:20 ` [PATCH v14 05/18] kunit: test: add the concept of expectations Brendan Higgins
     [not found] ` <20190820232046.50175-1-brendanhiggins-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2019-08-20 23:20   ` [PATCH v14 03/18] kunit: test: add string_stream a std::stream like string builder Brendan Higgins
2019-08-20 23:20   ` [PATCH v14 04/18] kunit: test: add assertion printing library Brendan Higgins
2019-08-20 23:20   ` [PATCH v14 06/18] kbuild: enable building KUnit Brendan Higgins
2019-08-20 23:20   ` [PATCH v14 07/18] kunit: test: add initial tests Brendan Higgins
2019-08-20 23:20   ` [PATCH v14 11/18] kunit: test: add the concept of assertions Brendan Higgins
2019-08-20 23:20   ` [PATCH v14 13/18] kunit: tool: add Python wrappers for running KUnit tests Brendan Higgins
2019-08-20 23:20   ` [PATCH v14 14/18] kunit: defconfig: add defconfigs for building " Brendan Higgins
2019-08-20 23:20   ` [PATCH v14 15/18] Documentation: kunit: add documentation for KUnit Brendan Higgins
2019-08-20 23:20   ` [PATCH v14 16/18] MAINTAINERS: add entry for KUnit the unit testing framework Brendan Higgins
2019-08-20 23:20   ` [PATCH v14 17/18] kernel/sysctl-test: Add null pointer test for sysctl.c:proc_dointvec() Brendan Higgins
2019-08-20 23:20   ` [PATCH v14 18/18] MAINTAINERS: add proc sysctl KUnit test to PROC SYSCTL section Brendan Higgins
2019-08-20 23:20 ` [PATCH v14 08/18] objtool: add kunit_try_catch_throw to the noreturn list Brendan Higgins
2019-08-20 23:20 ` [PATCH v14 09/18] kunit: test: add support for test abort Brendan Higgins
2019-08-23 15:36   ` shuah
2019-08-23 16:56     ` Brendan Higgins
2019-08-23 17:07       ` shuah
2019-08-23 17:29         ` Brendan Higgins
2019-08-20 23:20 ` [PATCH v14 10/18] kunit: test: add tests for kunit " Brendan Higgins
2019-08-20 23:20 ` [PATCH v14 12/18] kunit: test: add tests for KUnit managed resources Brendan Higgins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4513d9f3-a69b-a9a4-768b-86c2962b62e0@kernel.org \
    --to=shuah-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=Alexander.Levin-0li6OtcxBFHby3iVrkZq2A@public.gmane.org \
    --cc=amir73il-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=brendanhiggins-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=jdike-OPE4K8JWMJJBDgjK7y7TUQ@public.gmane.org \
    --cc=joel-U3u1mxZcP9KHXe+LvDLADg@public.gmane.org \
    --cc=khilman-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
    --cc=kieran.bingham-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
    --cc=knut.omang-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kbuild-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kselftest-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org \
    --cc=peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=pmladek-IBi9RG/b67k@public.gmane.org \
    --cc=rientjes-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=wfg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).