linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Daniel Latypov <dlatypov@google.com>
Cc: Brendan Higgins <brendanhiggins@google.com>,
	David Gow <davidgow@google.com>,
	Alan Maguire <alan.maguire@oracle.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	KUnit Development <kunit-dev@googlegroups.com>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	Uriel Guajardo <urielguajardo@google.com>,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v4 1/2] kunit: support failure from dynamic analysis tools
Date: Fri, 2 Apr 2021 15:44:50 -0600	[thread overview]
Message-ID: <3774e8c7-4183-d627-8c53-16bdc0bed6eb@linuxfoundation.org> (raw)
In-Reply-To: <CAGS_qxozjVfeOa42Y+v7dB0s6Ucvf8yHhRxDpficEJ9MGE-orw@mail.gmail.com>

On 4/2/21 3:25 PM, Daniel Latypov wrote:
> On Fri, Apr 2, 2021 at 10:53 AM Shuah Khan <skhan@linuxfoundation.org> wrote:
>>
>> On 4/2/21 2:55 AM, Brendan Higgins wrote:
>>> On Thu, Mar 11, 2021 at 7:23 AM Daniel Latypov <dlatypov@google.com> wrote:
>>>>
>>>> From: Uriel Guajardo <urielguajardo@google.com>
>>>>
>>>> Add a kunit_fail_current_test() function to fail the currently running
>>>> test, if any, with an error message.
>>>>
>>>> This is largely intended for dynamic analysis tools like UBSAN and for
>>>> fakes.
>>>> E.g. say I had a fake ops struct for testing and I wanted my `free`
>>>> function to complain if it was called with an invalid argument, or
>>>> caught a double-free. Most return void and have no normal means of
>>>> signalling failure (e.g. super_operations, iommu_ops, etc.).
>>>>
>>>> Key points:
>>>> * Always update current->kunit_test so anyone can use it.
>>>>     * commit 83c4e7a0363b ("KUnit: KASAN Integration") only updated it for
>>>>     CONFIG_KASAN=y
>>>>
>>>> * Create a new header <kunit/test-bug.h> so non-test code doesn't have
>>>> to include all of <kunit/test.h> (e.g. lib/ubsan.c)
>>>>
>>>> * Forward the file and line number to make it easier to track down
>>>> failures
>>>>
>>>> * Declare the helper function for nice __printf() warnings about mismatched
>>>> format strings even when KUnit is not enabled.
>>>>
>>>> Example output from kunit_fail_current_test("message"):
>>>> [15:19:34] [FAILED] example_simple_test
>>>> [15:19:34]     # example_simple_test: initializing
>>>> [15:19:34]     # example_simple_test: lib/kunit/kunit-example-test.c:24: message
>>>> [15:19:34]     not ok 1 - example_simple_test
>>>>
>>>> Co-developed-by: Daniel Latypov <dlatypov@google.com>
>>>> Signed-off-by: Daniel Latypov <dlatypov@google.com>
>>>> Signed-off-by: Uriel Guajardo <urielguajardo@google.com>
>>>> Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
>>>
>>> Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
>>>
>>
>> Please run checkpatch on your patches in the future. I am seeing
>> a few checkpatch readability type improvements that can be made.
>>
>> Please make changes and send v2 with Brendan's Reviewed-by.
> 
> Thanks for the catch.
> checkpatch.pl --strict should now be happy (aside from complaining
> about line wrapping)
> 
> v5 here: https://lore.kernel.org/linux-kselftest/20210402212131.835276-1-dlatypov@google.com
> 
> Note: Brendan didn't give an explicit Reviewed-by on the second patch,
> not sure if that was intentional.
> 

No worries. I applied this one as well. I was able to fix it with just
checkpatch --fix option.

All set now.

thanks,
-- Shuah


  reply	other threads:[~2021-04-02 21:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11 15:23 [PATCH v4 0/2] kunit: fail tests on UBSAN errors Daniel Latypov
2021-03-11 15:23 ` [PATCH v4 1/2] kunit: support failure from dynamic analysis tools Daniel Latypov
2021-04-02  8:55   ` Brendan Higgins
2021-04-02 17:53     ` Shuah Khan
2021-04-02 21:25       ` Daniel Latypov
2021-04-02 21:44         ` Shuah Khan [this message]
2021-04-02 21:47           ` Shuah Khan
2021-03-11 15:23 ` [PATCH v4 2/2] kunit: ubsan integration Daniel Latypov

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=3774e8c7-4183-d627-8c53-16bdc0bed6eb@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=alan.maguire@oracle.com \
    --cc=brendanhiggins@google.com \
    --cc=davidgow@google.com \
    --cc=dlatypov@google.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=urielguajardo@google.com \
    /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).