Linux RTC
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-rtc@vger.kernel.org
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Shuah Khan <shuah@kernel.org>,
	linux-kselftest@vger.kernel.org
Subject: [RFC PATCH 3/3] selftest: rtc: rtctest: skip properly if setting alarm fails
Date: Wed, 16 Sep 2026 23:31:11 +0200	[thread overview]
Message-ID: <20260916213108.9234-8-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20260916213108.9234-5-wsa+renesas@sang-engineering.com>

Use the proper framework call to mark a test as skipped. Currently, the
test is considered good, only the printout mentions the skip.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Maybe I am reading the logic wrong. But, the SKIPs I add here are hit
when setting an alarm fails. I wonder if this is really a SKIP and not
an error? We have already checked above if alarms are supported using a
designated check (and then skip), or?

 tools/testing/selftests/rtc/rtctest.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/tools/testing/selftests/rtc/rtctest.c b/tools/testing/selftests/rtc/rtctest.c
index 962050a32985..46fbaef9fdeb 100644
--- a/tools/testing/selftests/rtc/rtctest.c
+++ b/tools/testing/selftests/rtc/rtctest.c
@@ -250,8 +250,7 @@ TEST_F(rtc, alarm_alm_set) {
 		 */
 		ASSERT_EQ(RTC_ALARM_UNKNOWN, alarm_state);
 		ASSERT_EQ(EINVAL, errno);
-		TH_LOG("skip alarms are not supported.");
-		return;
+		SKIP(return, "alarms are not supported.");
 	}
 
 	rc = ioctl(self->fd, RTC_ALM_READ, &tm);
@@ -322,8 +321,7 @@ TEST_F(rtc, alarm_wkalm_set) {
 		 */
 		ASSERT_EQ(RTC_ALARM_UNKNOWN, alarm_state);
 		ASSERT_EQ(EINVAL, errno);
-		TH_LOG("skip alarms are not supported.");
-		return;
+		SKIP(return, "alarms are not supported.");
 	}
 
 	rc = ioctl(self->fd, RTC_WKALM_RD, &alarm);
@@ -382,8 +380,7 @@ TEST_F_TIMEOUT(rtc, alarm_alm_set_minute, 65) {
 		 */
 		ASSERT_EQ(RTC_ALARM_UNKNOWN, alarm_state);
 		ASSERT_EQ(EINVAL, errno);
-		TH_LOG("skip alarms are not supported.");
-		return;
+		SKIP(return, "alarms are not supported.");
 	}
 
 	rc = ioctl(self->fd, RTC_ALM_READ, &tm);
@@ -452,8 +449,7 @@ TEST_F_TIMEOUT(rtc, alarm_wkalm_set_minute, 65) {
 		 */
 		ASSERT_EQ(RTC_ALARM_UNKNOWN, alarm_state);
 		ASSERT_EQ(EINVAL, errno);
-		TH_LOG("skip alarms are not supported.");
-		return;
+		SKIP(return, "alarms are not supported.");
 	}
 
 	rc = ioctl(self->fd, RTC_WKALM_RD, &alarm);
-- 
2.53.0


  parent reply	other threads:[~2026-09-16 21:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 21:31 [PATCH 0/3] selftest: rtc: rtctest: improve handling of skipped tests Wolfram Sang
2026-09-16 21:31 ` [PATCH 1/3] selftest: rtc: rtctest: don't mention skipping twice Wolfram Sang
2026-09-16 21:38   ` sashiko-bot
2026-09-16 21:31 ` [PATCH 2/3] selftest: rtc: rtctest: make missing UIEs really skip Wolfram Sang
2026-09-16 21:39   ` sashiko-bot
2026-09-16 21:31 ` Wolfram Sang [this message]
2026-09-16 21:35   ` [RFC PATCH 3/3] selftest: rtc: rtctest: skip properly if setting alarm fails sashiko-bot
2026-10-08 19:48 ` [PATCH 0/3] selftest: rtc: rtctest: improve handling of skipped tests Wolfram Sang
2026-10-08 22:19   ` Alexandre Belloni

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=20260916213108.9234-8-wsa+renesas@sang-engineering.com \
    --to=wsa+renesas@sang-engineering.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-rtc@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
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