All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v3 1/3] include/tst_test_macros.h: Add TST_EXP_{PASS, FD}_SILENT macros
@ 2021-01-12  2:02 Xiao Yang
  2021-01-12  2:02 ` [LTP] [PATCH v3 2/3] syscalls/open01.c: Take use of TST_EXP_FD_SILENT Xiao Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Xiao Yang @ 2021-01-12  2:02 UTC (permalink / raw)
  To: ltp

1) TST_EXP_{PASS,FD}_SILENT don't report TPASS when SCALL succeeds.
2) TST_EXP_{PASS,FD} calls TST_EXP_{PASS,FD}_SILENT and reports
   TPASS when SCALL succeeds.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 include/tst_test_macros.h | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/include/tst_test_macros.h b/include/tst_test_macros.h
index 3016d95c2..92cb5c66b 100644
--- a/include/tst_test_macros.h
+++ b/include/tst_test_macros.h
@@ -46,7 +46,7 @@ extern void *TST_RET_PTR;
 	tst_res_(__FILE__, __LINE__, RES, \
 		TST_FMT_(TST_2_(dummy, ##__VA_ARGS__, SCALL) FMT, __VA_ARGS__), PAR)
 
-#define TST_EXP_FD(SCALL, ...)                                                 \
+#define TST_EXP_FD_SILENT(SCALL, ...)                                          \
 	do {                                                                   \
 		TEST(SCALL);                                                   \
 		                                                               \
@@ -64,14 +64,20 @@ extern void *TST_RET_PTR;
 			break;                                                 \
 		}                                                              \
                                                                                \
-		TST_MSGP_(TPASS, " returned fd %ld", TST_RET,                  \
-		         #SCALL, ##__VA_ARGS__);                               \
-                                                                               \
 		TST_PASS = 1;                                                  \
                                                                                \
 	} while (0)
 
-#define TST_EXP_PASS(SCALL, ...)                                               \
+#define TST_EXP_FD(SCALL, ...)                                                 \
+	do {                                                                   \
+		TST_EXP_FD_SILENT(SCALL, __VA_ARGS__);                         \
+		                                                               \
+		if (TST_PASS)                                                  \
+			TST_MSGP_(TPASS, " returned fd %ld", TST_RET,          \
+				#SCALL, ##__VA_ARGS__);                        \
+	} while (0)
+
+#define TST_EXP_PASS_SILENT(SCALL, ...)                                        \
 	do {                                                                   \
 		TEST(SCALL);                                                   \
 		                                                               \
@@ -89,12 +95,17 @@ extern void *TST_RET_PTR;
 			break;                                                 \
 		}                                                              \
                                                                                \
-		TST_MSG_(TPASS, " passed", #SCALL, ##__VA_ARGS__);             \
-                                                                               \
 		TST_PASS = 1;                                                  \
                                                                                \
 	} while (0)
 
+#define TST_EXP_PASS(SCALL, ...)                                               \
+	do {                                                                   \
+		TST_EXP_PASS_SILENT(SCALL, __VA_ARGS__);                       \
+		                                                               \
+		if (TST_PASS)                                                  \
+			TST_MSG_(TPASS, " passed", #SCALL, ##__VA_ARGS__);     \
+	} while (0)                                                            \
 
 #define TST_EXP_FAIL(SCALL, ERRNO, ...)                                        \
 	do {                                                                   \
-- 
2.21.0




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

end of thread, other threads:[~2021-01-25  3:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-12  2:02 [LTP] [PATCH v3 1/3] include/tst_test_macros.h: Add TST_EXP_{PASS, FD}_SILENT macros Xiao Yang
2021-01-12  2:02 ` [LTP] [PATCH v3 2/3] syscalls/open01.c: Take use of TST_EXP_FD_SILENT Xiao Yang
2021-01-12  2:02 ` [LTP] [PATCH v3 3/3] syscalls: Take use of TST_EXP_PASS_SILENT Xiao Yang
2021-01-20 10:34   ` Cyril Hrubis
2021-01-21  2:21     ` Xiao Yang
2021-01-22 13:47       ` Cyril Hrubis
2021-01-25  3:44         ` Xiao Yang
2021-01-20  9:51 ` [LTP] [PATCH v3 1/3] include/tst_test_macros.h: Add TST_EXP_{PASS, FD}_SILENT macros Xiao Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.