From: David Gow <davidgow@google.com>
To: Brendan Higgins <brendanhiggins@google.com>,
Rae Moar <rmr167@gmail.com>, Daniel Latypov <dlatypov@google.com>,
Shuah Khan <skhan@linuxfoundation.org>
Cc: David Gow <davidgow@google.com>,
kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] kunit: Report test parameter results as (K)TAP subtests
Date: Wed, 20 Oct 2021 23:28:19 -0700 [thread overview]
Message-ID: <20211021062819.1313964-2-davidgow@google.com> (raw)
In-Reply-To: <20211021062819.1313964-1-davidgow@google.com>
Currently, the results for individial parameters in a parameterised test
are simply output as (K)TAP diagnostic lines. However, the plan was
always[1] to make these (K)TAP subtests when kunit_tool supported them.
With [2], these are now supported. (v5 will print out an error about the
missing plan line, but this can safely be ignored, and will hopefully be
changed). As a result, individual test parameter results are parsed,
displayed in the formatted results, and counted for test statistics.
[1]: https://lore.kernel.org/linux-kselftest/CABVgOSnJAgWvTTABaF082LuYjAoAWzrBsyu9sT7x4GGMVsOD6Q@mail.gmail.com/
[2]: https://lore.kernel.org/linux-kselftest/20211006001447.20919-1-dlatypov@google.com/
Signed-off-by: David Gow <davidgow@google.com>
---
Note that this was previously posted as:
https://lore.kernel.org/all/20211006071112.2206942-1-davidgow@google.com/
No changes have been made, save for a trivial rebase on the current
kselftest/kunit branch.
lib/kunit/test.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/kunit/test.c b/lib/kunit/test.c
index 3bd741e50a2d..85265f9a66a1 100644
--- a/lib/kunit/test.c
+++ b/lib/kunit/test.c
@@ -508,6 +508,8 @@ int kunit_run_tests(struct kunit_suite *suite)
/* Get initial param. */
param_desc[0] = '\0';
test.param_value = test_case->generate_params(NULL, param_desc);
+ kunit_log(KERN_INFO, &test, KUNIT_SUBTEST_INDENT KUNIT_SUBTEST_INDENT
+ "# Subtest: %s", test_case->name);
}
do {
@@ -520,9 +522,8 @@ int kunit_run_tests(struct kunit_suite *suite)
}
kunit_log(KERN_INFO, &test,
- KUNIT_SUBTEST_INDENT
- "# %s: %s %d - %s",
- test_case->name,
+ KUNIT_SUBTEST_INDENT KUNIT_SUBTEST_INDENT
+ "%s %d - %s",
kunit_status_to_ok_not_ok(test.status),
test.param_index + 1, param_desc);
--
2.33.0.1079.g6e70778dc9-goog
next prev parent reply other threads:[~2021-10-21 6:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-21 6:28 [PATCH 1/2] kunit: tool: Do not error on tests without test plans David Gow
2021-10-21 6:28 ` David Gow [this message]
2021-10-22 1:15 ` [PATCH 2/2] kunit: Report test parameter results as (K)TAP subtests Daniel Latypov
2021-10-22 6:16 ` David Gow
2021-10-22 22:29 ` Daniel Latypov
2021-10-22 1:29 ` [PATCH 1/2] kunit: tool: Do not error on tests without test plans Daniel Latypov
2021-10-22 6:10 ` David Gow
2021-10-22 22:41 ` Daniel Latypov
2021-10-23 0:25 ` David Gow
2021-10-25 21:14 ` Brendan Higgins
2021-10-25 15:21 ` 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=20211021062819.1313964-2-davidgow@google.com \
--to=davidgow@google.com \
--cc=brendanhiggins@google.com \
--cc=dlatypov@google.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=rmr167@gmail.com \
--cc=skhan@linuxfoundation.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
all inboxes | Powered by JetHome®