From: David Gow <davidgow@google.com>
To: Brendan Higgins <brendanhiggins@google.com>,
Alan Maguire <alan.maguire@oracle.com>
Cc: Marco Elver <elver@google.com>,
Daniel Latypov <dlatypov@google.com>,
Shuah Khan <skhan@linuxfoundation.org>,
kunit-dev@googlegroups.com, kasan-dev@googlegroups.com,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
David Gow <davidgow@google.com>
Subject: [PATCH v2 4/4] kasan: test: make use of kunit_skip()
Date: Fri, 28 May 2021 00:59:32 -0700 [thread overview]
Message-ID: <20210528075932.347154-4-davidgow@google.com> (raw)
In-Reply-To: <20210528075932.347154-1-davidgow@google.com>
From: Marco Elver <elver@google.com>
Make use of the recently added kunit_skip() to skip tests, as it permits
TAP parsers to recognize if a test was deliberately skipped.
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: David Gow <davidgow@google.com>
---
lib/test_kasan.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/lib/test_kasan.c b/lib/test_kasan.c
index cacbbbdef768..0a2029d14c91 100644
--- a/lib/test_kasan.c
+++ b/lib/test_kasan.c
@@ -111,17 +111,13 @@ static void kasan_test_exit(struct kunit *test)
} while (0)
#define KASAN_TEST_NEEDS_CONFIG_ON(test, config) do { \
- if (!IS_ENABLED(config)) { \
- kunit_info((test), "skipping, " #config " required"); \
- return; \
- } \
+ if (!IS_ENABLED(config)) \
+ kunit_skip((test), "Test requires " #config "=y"); \
} while (0)
#define KASAN_TEST_NEEDS_CONFIG_OFF(test, config) do { \
- if (IS_ENABLED(config)) { \
- kunit_info((test), "skipping, " #config " enabled"); \
- return; \
- } \
+ if (IS_ENABLED(config)) \
+ kunit_skip((test), "Test requires " #config "=n"); \
} while (0)
static void kmalloc_oob_right(struct kunit *test)
--
2.32.0.rc0.204.g9fa02ecfa5-goog
next prev parent reply other threads:[~2021-05-28 8:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-28 7:59 [PATCH v2 1/4] kunit: Support skipped tests David Gow
2021-05-28 7:59 ` [PATCH v2 2/4] kunit: tool: Support skipped tests in kunit_tool David Gow
2021-06-01 15:46 ` Daniel Latypov
2021-06-04 21:30 ` Brendan Higgins
2021-06-04 21:44 ` Daniel Latypov
2021-05-28 7:59 ` [PATCH v2 3/4] kunit: test: Add example tests which are always skipped David Gow
2021-05-28 7:59 ` David Gow [this message]
2021-06-01 15:44 ` [PATCH v2 4/4] kasan: test: make use of kunit_skip() Daniel Latypov
2021-06-02 12:29 ` Andrey Konovalov
2021-05-28 9:46 ` [PATCH v2 1/4] kunit: Support skipped tests kernel test robot
2021-05-28 9:59 ` kernel test robot
2021-06-04 21:04 ` 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=20210528075932.347154-4-davidgow@google.com \
--to=davidgow@google.com \
--cc=alan.maguire@oracle.com \
--cc=brendanhiggins@google.com \
--cc=dlatypov@google.com \
--cc=elver@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).