public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/2] syscalls/timer_settime01: Improve print messages
@ 2020-06-29 11:43 Viresh Kumar
  2020-06-29 11:43 ` [LTP] [PATCH 2/2] syscalls/timer_settime01: Make sure the timer fires Viresh Kumar
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Viresh Kumar @ 2020-06-29 11:43 UTC (permalink / raw)
  To: ltp

This improves the print messages by providing additional information
about the tests.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 .../syscalls/timer_settime/timer_settime01.c  | 31 ++++++++++---------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/testcases/kernel/syscalls/timer_settime/timer_settime01.c b/testcases/kernel/syscalls/timer_settime/timer_settime01.c
index 08fb56e4943a..52c435ee3d91 100644
--- a/testcases/kernel/syscalls/timer_settime/timer_settime01.c
+++ b/testcases/kernel/syscalls/timer_settime/timer_settime01.c
@@ -82,12 +82,12 @@ static void run(unsigned int n)
 		if (TST_RET != 0) {
 			if (possibly_unsupported(clock) &&
 				(TST_ERR == EINVAL || TST_ERR == ENOTSUP)) {
-				tst_res(TCONF | TTERRNO, "%s unsupported",
-					get_clock_str(clock));
+				tst_res(TCONF | TTERRNO, "%s: %s unsupported",
+					tv->desc, get_clock_str(clock));
 			} else {
 				tst_res(TFAIL | TTERRNO,
-					"timer_create(%s) failed",
-					get_clock_str(clock));
+					"%s: timer_create(%s) failed",
+					tv->desc, get_clock_str(clock));
 			}
 			continue;
 		}
@@ -102,9 +102,8 @@ static void run(unsigned int n)
 		if (tc->flag & TIMER_ABSTIME) {
 			timenow.type = tv->type;
 			if (tv->gettime(clock, tst_ts_get(&timenow)) < 0) {
-				tst_res(TFAIL,
-					"clock_gettime(%s) failed - skipping the test",
-					get_clock_str(clock));
+				tst_res(TFAIL, "%s: clock_gettime(%s) failed - skipping the test",
+					tv->desc, get_clock_str(clock));
 				continue;
 			}
 			val += tst_ts_get_sec(timenow);
@@ -115,19 +114,21 @@ static void run(unsigned int n)
 		tst_its_set_value_sec(&new_set, val);
 		tst_its_set_value_nsec(&new_set, 0);
 
-		TEST(tv->func(timer, tc->flag, tst_its_get(&new_set), tst_its_get(tc->old_ptr)));
-
+		TEST(tv->func(timer, tc->flag, tst_its_get(&new_set),
+			      tst_its_get(tc->old_ptr)));
 		if (TST_RET != 0) {
-			tst_res(TFAIL | TTERRNO, "%s failed",
-					get_clock_str(clock));
+			tst_res(TFAIL | TTERRNO, "%s: timer_settime(%s) failed",
+				tv->desc, get_clock_str(clock));
 		} else {
-			tst_res(TPASS, "%s was successful",
-					get_clock_str(clock));
+			tst_res(TPASS, "%s: timer_settime(%s) was successful",
+				tv->desc, get_clock_str(clock));
 		}
 
 		TEST(tst_syscall(__NR_timer_delete, timer));
-		if (TST_RET != 0)
-			tst_res(TFAIL | TTERRNO, "timer_delete() failed!");
+		if (TST_RET != 0) {
+			tst_res(TFAIL | TTERRNO, "%s: %s: timer_delete() failed!",
+				tv->desc, get_clock_str(clock));
+		}
 	}
 }
 
-- 
2.25.0.rc1.19.g042ed3e048af


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2020-07-24 15:01 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-29 11:43 [LTP] [PATCH 1/2] syscalls/timer_settime01: Improve print messages Viresh Kumar
2020-06-29 11:43 ` [LTP] [PATCH 2/2] syscalls/timer_settime01: Make sure the timer fires Viresh Kumar
2020-06-29 12:05   ` Arnd Bergmann
2020-06-29 12:13     ` Cyril Hrubis
2020-06-30  2:27       ` Viresh Kumar
2020-06-30  2:36 ` [LTP] [PATCH V1.1 " Viresh Kumar
2020-07-02 13:34 ` [LTP] [PATCH 1/2] syscalls/timer_settime01: Improve print messages Cyril Hrubis
2020-07-03  2:22   ` Viresh Kumar
2020-07-03  2:39 ` [LTP] [PATCH V2] syscalls/timer_settime01: Make sure the timer fires Viresh Kumar
2020-07-07 15:02   ` Cyril Hrubis
2020-07-08 10:31   ` [LTP] [PATCH V3] " Viresh Kumar
2020-07-14 14:28     ` Cyril Hrubis
2020-07-15  2:36       ` Viresh Kumar
2020-07-15  8:53         ` Cyril Hrubis
2020-07-23  2:39       ` Yang Xu
2020-07-24  3:37         ` Viresh Kumar
2020-07-24  5:07           ` Yang Xu
2020-07-24 10:18             ` Viresh Kumar
2020-07-24 10:27               ` Yang Xu
2020-07-24 13:29             ` Cyril Hrubis
2020-07-24 15:01               ` Yang Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox