Linux-kselftest Archive on lore.kernel.org
 help / color / Atom feed
From: Frank Rowand <frowand.list@gmail.com>
To: Alan Maguire <alan.maguire@oracle.com>
Cc: brendanhiggins@google.com, gregkh@linuxfoundation.org,
	shuah@kernel.org, linux-kselftest@vger.kernel.org,
	kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org, corbet@lwn.net, davidgow@google.com
Subject: Re: [PATCH v3 kunit-next 1/2] kunit: add debugfs /sys/kernel/debug/kunit/<suite>/results display
Date: Mon, 17 Feb 2020 11:04:42 -0600
Message-ID: <51e1d60c-a232-bbef-7e6a-8695df684ae6@gmail.com> (raw)
In-Reply-To: <alpine.LRH.2.20.2002171539210.21685@dhcp-10-175-161-198.vpn.oracle.com>

On 2/17/20 9:45 AM, Alan Maguire wrote:
> On Wed, 12 Feb 2020, Frank Rowand wrote:
> 
>> On 2/7/20 10:58 AM, Alan Maguire wrote:
>>> add debugfs support for displaying kunit test suite results; this is
>>> especially useful for module-loaded tests to allow disentangling of
>>> test result display from other dmesg events.
>>>
>>> As well as printk()ing messages, we append them to a per-test log.
>>>
>>> Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
>>> ---

< snip >

>>> diff --git a/lib/kunit/test.c b/lib/kunit/test.c
>>> index 9242f93..aec607f 100644
>>> --- a/lib/kunit/test.c
>>> +++ b/lib/kunit/test.c
>>> @@ -10,6 +10,7 @@
>>>  #include <linux/kernel.h>
>>>  #include <linux/sched/debug.h>
>>>  
>>> +#include "debugfs.h"
>>>  #include "string-stream.h"
>>>  #include "try-catch-impl.h"
>>>  
>>> @@ -28,73 +29,91 @@ static void kunit_print_tap_version(void)
>>>  	}
>>>  }
>>>  
>>> -static size_t kunit_test_cases_len(struct kunit_case *test_cases)
>>> +size_t kunit_suite_num_test_cases(struct kunit_suite *suite)
>>>  {
>>>  	struct kunit_case *test_case;
>>>  	size_t len = 0;
>>>  
>>> -	for (test_case = test_cases; test_case->run_case; test_case++)
>>> +	kunit_suite_for_each_test_case(suite, test_case)
>>>  		len++;
>>>  
>>>  	return len;
>>>  }
>>> +EXPORT_SYMBOL_GPL(kunit_suite_num_test_cases);
>>>  
>>>  static void kunit_print_subtest_start(struct kunit_suite *suite)
>>>  {
>>>  	kunit_print_tap_version();
>>> -	pr_info("\t# Subtest: %s\n", suite->name);
>>> -	pr_info("\t1..%zd\n", kunit_test_cases_len(suite->test_cases));
>>> +	kunit_log(KERN_INFO, suite, "# Subtest: %s", suite->name);
>>> +	kunit_log(KERN_INFO, suite, "1..%zd",
>>> +		  kunit_suite_num_test_cases(suite));
>>
>> The subtest 'is a TAP stream indented 4 spaces'.  (So the old code was
>> also incorrect since it indented with a tab.)
>>
>> kunit_print_ok_not_ok() has a similar indentation issue.
>>
> 
> I'll defer to Brendan on the TAP format stuff if you don't
> mind; the aim here is to preserve existing behaviour.  I
> think it might be better to tackle TAP format issues in
> a separate patchset.

My first attempt to respond started with "That is a reasonable approach".
But on reflection, the patch is adding code that is incorrect (even if
the new code is replacing existing code that is incorrect).

If you don't want to change the spacing in patch 1/2, then please add
patch 3/3 that corrects the spacing.  That allows patches 1/3 and 2/3
to preserve existing behaviour.

Thanks,

Frank

> 
> I also updated the documentation patch in v4 (patch 3)
> to incorporate the suggested wording.
> 
> Thanks for the careful review!
> 
> Alan
>  
>>

< snip >

  reply index

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07 16:58 [PATCH v3 kunit-next 0/2] kunit: add debugfs representation to show results/run tests Alan Maguire
2020-02-07 16:58 ` [PATCH v3 kunit-next 1/2] kunit: add debugfs /sys/kernel/debug/kunit/<suite>/results display Alan Maguire
2020-02-11 21:58   ` Brendan Higgins
2020-02-13  3:25   ` Frank Rowand
2020-02-17 15:45     ` Alan Maguire
2020-02-17 17:04       ` Frank Rowand [this message]
2020-02-18 19:46     ` Brendan Higgins
2020-02-18 20:49       ` Bird, Tim
2020-02-18 22:03         ` Brendan Higgins
2020-02-18 22:28           ` Bird, Tim
2020-02-19  1:18         ` Frank Rowand
2020-02-19  1:10       ` Frank Rowand
2020-02-07 16:58 ` [PATCH v3 kunit-next 2/2] kunit: update documentation to describe debugfs representation Alan Maguire
2020-02-11 22:01   ` Brendan Higgins
2020-02-13  3:25   ` Frank Rowand

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=51e1d60c-a232-bbef-7e6a-8695df684ae6@gmail.com \
    --to=frowand.list@gmail.com \
    --cc=alan.maguire@oracle.com \
    --cc=brendanhiggins@google.com \
    --cc=corbet@lwn.net \
    --cc=davidgow@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.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

Linux-kselftest Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-kselftest/0 linux-kselftest/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-kselftest linux-kselftest/ https://lore.kernel.org/linux-kselftest \
		linux-kselftest@vger.kernel.org
	public-inbox-index linux-kselftest

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kselftest


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git