[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6b41e9fe-aa9e-698b-d356-0227e6f2021c@kernel.org>
Date: Wed, 25 Mar 2020 16:11:08 -0600
From: shuah <shuah@...nel.org>
To: Alan Maguire <alan.maguire@...cle.com>
Cc: brendanhiggins@...gle.com, frowand.list@...il.com,
gregkh@...uxfoundation.org, corbet@....net,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
kunit-dev@...glegroups.com, linux-doc@...r.kernel.org,
shuah <shuah@...nel.org>
Subject: Re: [PATCH v7 kunit-next 3/4] kunit: subtests should be indented 4
spaces according to TAP
On 3/25/20 4:03 PM, Alan Maguire wrote:
> On Wed, 25 Mar 2020, shuah wrote:
>
>> On 3/13/20 8:44 AM, Alan Maguire wrote:
>>> Introduce KUNIT_INDENT macro which corresponds to 4-space indentation,
>>> and use it to modify indentation from tab to 4 spaces.
>>>
>>> Suggested-by: Frank Rowand <frowand.list@...il.com>
>>> Signed-off-by: Alan Maguire <alan.maguire@...cle.com>
>>> Reviewed-by: Frank Rowand <frank.rowand@...y.com>
>>> ---
>>> include/kunit/test.h | 7 +++-
>>> lib/kunit/assert.c | 79
>>> +++++++++++++++++++------------------
>>> lib/kunit/test.c | 6 +--
>>> tools/testing/kunit/kunit_parser.py | 10 ++---
>>> 4 files changed, 54 insertions(+), 48 deletions(-)
>>>
>>> diff --git a/include/kunit/test.h b/include/kunit/test.h
>>> index f7b2ed4c..d49cdb4 100644
>>> --- a/include/kunit/test.h
>>> +++ b/include/kunit/test.h
>>> @@ -84,6 +84,10 @@ struct kunit_resource {
>>> /* Size of log associated with test. */
>>> #define KUNIT_LOG_SIZE 512
>>>
>>> +/* TAP specifies subtest indentation of 4 spaces. */
>>> +#define KUNIT_INDENT " "
>>> +#define KUNIT_INDENT2 KUNIT_INDENT KUNIT_INDENT
>>
>> Sorry for a late comment on this.
>>
>> What's the reason to do it this way? Why wouldn't you define
>> it as 8 spaces long string?
>>
>
> I could have I suppose; I thought it makes it a bit easier
> to read as above (though it did generate a checkpatch
> warning; I thought readability was more important in this
> case, but I can alter if needed).
>
Please do. Couple of things. KUNIT_INDENT2 doesn't really
tell me much. Same with KUNIT_INDENT
Please make the names more descriptive. Something along the
lines of
KUNIT_INDENT_4SPACE
KUNIT_INDENT_8SPACE
>> Also can you please make sure to run checkpatch --strict on the
>> patches you send?
>>
>
> Sure! There were also some other line-too-long warnings
> generated as a result of this patch, but when I fixed those
> checkpatch complained about splitting strings across multiple
> lines. The only way out was to reduce the amount of information
> in the log messages, which I didn't want to do. In future I can
> note checkpatch warnings that I couldn't find a way to fix in the
> commit message if that would help?
>
I understand. This is an error though. I am willing to ignore line-too
long warnings for the most part. I don't like to see errors in general.
thanks,
-- Shuah
Powered by blists - more mailing lists