From: Muhammad Usama Anjum <usama.anjum@collabora.com>
To: Shuah Khan <shuah@kernel.org>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
Muhammad Usama Anjum <usama.anjum@collabora.com>,
Colin Ian King <colin.i.king@gmail.com>,
Tiezhu Yang <yangtiezhu@loongson.cn>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: kernel@collabora.com
Subject: [PATCH 3/4] kselftests: vdso: vdso_test_getcpu: conform test to TAP output
Date: Wed, 29 May 2024 12:24:53 +0500 [thread overview]
Message-ID: <20240529072454.2522495-4-usama.anjum@collabora.com> (raw)
In-Reply-To: <20240529072454.2522495-1-usama.anjum@collabora.com>
Conform the layout, informational and status messages to TAP. No
functional change is intended other than the layout of output messages.
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
tools/testing/selftests/vDSO/vdso_test_getcpu.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/tools/testing/selftests/vDSO/vdso_test_getcpu.c b/tools/testing/selftests/vDSO/vdso_test_getcpu.c
index b758f68c6c9c2..d8e247783057a 100644
--- a/tools/testing/selftests/vDSO/vdso_test_getcpu.c
+++ b/tools/testing/selftests/vDSO/vdso_test_getcpu.c
@@ -28,9 +28,12 @@ int main(int argc, char **argv)
getcpu_t get_cpu;
long ret;
+ ksft_print_header();
+ ksft_set_plan(1);
+
sysinfo_ehdr = getauxval(AT_SYSINFO_EHDR);
if (!sysinfo_ehdr) {
- printf("AT_SYSINFO_EHDR is not present!\n");
+ ksft_print_msg("AT_SYSINFO_EHDR is not present!\n");
return KSFT_SKIP;
}
@@ -38,17 +41,12 @@ int main(int argc, char **argv)
get_cpu = (getcpu_t)vdso_sym(version, name[4]);
if (!get_cpu) {
- printf("Could not find %s\n", name[4]);
+ ksft_print_msg("Could not find %s\n", name[4]);
return KSFT_SKIP;
}
ret = get_cpu(&cpu, &node, 0);
- if (ret == 0) {
- printf("Running on CPU %u node %u\n", cpu, node);
- } else {
- printf("%s failed\n", name[4]);
- return KSFT_FAIL;
- }
+ ksft_test_result(ret == 0, "Running on CPU %u node %u\n", cpu, node);
- return 0;
+ ksft_finished();
}
--
2.39.2
next prev parent reply other threads:[~2024-05-29 7:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 7:24 [PATCH 0/4] kselftests: vdso: conform tests " Muhammad Usama Anjum
2024-05-29 7:24 ` [PATCH 1/4] kselftests: vdso: vdso_test_clock_getres: conform test " Muhammad Usama Anjum
2024-06-07 20:15 ` Shuah Khan
2024-05-29 7:24 ` [PATCH 2/4] kselftests: vdso: vdso_test_correctness: " Muhammad Usama Anjum
2024-05-29 7:24 ` Muhammad Usama Anjum [this message]
2024-05-29 7:24 ` [PATCH 4/4] kselftests: vdso: vdso_test_gettimeofday: " Muhammad Usama Anjum
2024-06-07 20:16 ` [PATCH 0/4] kselftests: vdso: conform tests " Shuah Khan
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=20240529072454.2522495-4-usama.anjum@collabora.com \
--to=usama.anjum@collabora.com \
--cc=akpm@linux-foundation.org \
--cc=colin.i.king@gmail.com \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=vincenzo.frascino@arm.com \
--cc=yangtiezhu@loongson.cn \
/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®