From: Mark Brown <broonie@kernel.org>
To: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>, Shuah Khan <shuah@kernel.org>
Cc: Joey Gouly <joey.gouly@arm.com>,
inux-arm-kernel@lists.infradead.org,
linux-kselftest@vger.kernel.org, Mark Brown <broonie@kernel.org>,
Shuah Khan <skhan@linuxfoundation.org>
Subject: [PATCH v2 1/4] kselftest/arm64: Handle more kselftest result codes in MTE helpers
Date: Tue, 19 Apr 2022 11:28:05 +0100 [thread overview]
Message-ID: <20220419102808.24522-2-broonie@kernel.org> (raw)
In-Reply-To: <20220419102808.24522-1-broonie@kernel.org>
The MTE selftests have a helper evaluate_test() which translates a return
code into a call to ksft_test_result_*(). Currently this only handles pass
and fail, silently ignoring any other code. Update the helper to support
skipped tests and log any unknown return codes as an error so we get at
least some diagnostic if anything goes wrong.
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
---
.../testing/selftests/arm64/mte/mte_common_util.h | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/arm64/mte/mte_common_util.h b/tools/testing/selftests/arm64/mte/mte_common_util.h
index 195a7d1879e6..2d3e71724e55 100644
--- a/tools/testing/selftests/arm64/mte/mte_common_util.h
+++ b/tools/testing/selftests/arm64/mte/mte_common_util.h
@@ -75,10 +75,21 @@ unsigned int mte_get_pstate_tco(void);
/* Test framework static inline functions/macros */
static inline void evaluate_test(int err, const char *msg)
{
- if (err == KSFT_PASS)
+ switch (err) {
+ case KSFT_PASS:
ksft_test_result_pass(msg);
- else if (err == KSFT_FAIL)
+ break;
+ case KSFT_FAIL:
ksft_test_result_fail(msg);
+ break;
+ case KSFT_SKIP:
+ ksft_test_result_skip(msg);
+ break;
+ default:
+ ksft_test_result_error("Unknown return code %d from %s",
+ err, msg);
+ break;
+ }
}
static inline int check_allocated_memory(void *ptr, size_t size,
--
2.30.2
next prev parent reply other threads:[~2022-04-19 10:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-19 10:28 [PATCH v2 0/4] kselftest/arm64: Miscelaneous MTE test updates Mark Brown
2022-04-19 10:28 ` Mark Brown [this message]
2022-04-19 10:28 ` [PATCH v2 2/4] kselftest/arm64: Log unexpected asynchronous MTE faults Mark Brown
2022-04-19 10:28 ` [PATCH v2 3/4] kselftest/arm64: Refactor parameter checking in mte_switch_mode() Mark Brown
2022-04-19 10:28 ` [PATCH v2 4/4] kselftest/arm64: Add simple test for MTE prctl Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2022-04-19 10:32 [PATCH v2 0/4] kselftest/arm64: Miscelaneous MTE test updates Mark Brown
2022-04-19 10:32 ` [PATCH v2 1/4] kselftest/arm64: Handle more kselftest result codes in MTE helpers Mark Brown
2022-03-11 13:51 [PATCH v2 0/4] kselftest/arm64: Miscelaneous MTE test updates Mark Brown
2022-03-11 13:51 ` [PATCH v2 1/4] kselftest/arm64: Handle more kselftest result codes in MTE helpers Mark Brown
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=20220419102808.24522-2-broonie@kernel.org \
--to=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=inux-arm-kernel@lists.infradead.org \
--cc=joey.gouly@arm.com \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=will@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
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