* [LTP] [PATCH] tst_test_macros.h: Make TST_EXP_POSSITIVE() print TPASS as well
@ 2021-08-11 9:21 Cyril Hrubis
2021-08-20 9:45 ` Petr Vorel
0 siblings, 1 reply; 3+ messages in thread
From: Cyril Hrubis @ 2021-08-11 9:21 UTC (permalink / raw)
To: ltp
So that it could be used in the tests.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
CC: sujiaxun <sujiaxun@uniontech.com>
---
include/tst_test_macros.h | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/include/tst_test_macros.h b/include/tst_test_macros.h
index cd65d8d0d..d9d7f930f 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_POSITIVE(SCALL, ...) \
+#define TST_EXP_POSITIVE_(SCALL, ...) \
do { \
TEST(SCALL); \
\
@@ -68,7 +68,17 @@ extern void *TST_RET_PTR;
\
} while (0)
-#define TST_EXP_FD_SILENT(SCALL, ...) TST_EXP_POSITIVE(SCALL, __VA_ARGS__)
+#define TST_EXP_POSITIVE(SCALL, ...) \
+ do { \
+ TST_EXP_POSITIVE_(SCALL, __VA_ARGS__); \
+ \
+ if (TST_PASS) { \
+ TST_MSGP_(TPASS, " returned %ld", \
+ TST_RET, #SCALL, ##__VA_ARGS__); \
+ } \
+ } while (0)
+
+#define TST_EXP_FD_SILENT(SCALL, ...) TST_EXP_POSITIVE_(SCALL, __VA_ARGS__)
#define TST_EXP_FD(SCALL, ...) \
do { \
@@ -79,7 +89,7 @@ extern void *TST_RET_PTR;
#SCALL, ##__VA_ARGS__); \
} while (0)
-#define TST_EXP_PID_SILENT(SCALL, ...) TST_EXP_POSITIVE(SCALL, __VA_ARGS__)
+#define TST_EXP_PID_SILENT(SCALL, ...) TST_EXP_POSITIVE_(SCALL, __VA_ARGS__)
#define TST_EXP_PID(SCALL, ...) \
do { \
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [LTP] [PATCH] tst_test_macros.h: Make TST_EXP_POSSITIVE() print TPASS as well
2021-08-11 9:21 [LTP] [PATCH] tst_test_macros.h: Make TST_EXP_POSSITIVE() print TPASS as well Cyril Hrubis
@ 2021-08-20 9:45 ` Petr Vorel
2021-08-20 13:54 ` Cyril Hrubis
0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2021-08-20 9:45 UTC (permalink / raw)
To: ltp
Hi Cyril,
good idea.
nit: TST_EXP_POSSITIVE => TST_EXP_POSITIVE in commit message subject.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
^ permalink raw reply [flat|nested] 3+ messages in thread
* [LTP] [PATCH] tst_test_macros.h: Make TST_EXP_POSSITIVE() print TPASS as well
2021-08-20 9:45 ` Petr Vorel
@ 2021-08-20 13:54 ` Cyril Hrubis
0 siblings, 0 replies; 3+ messages in thread
From: Cyril Hrubis @ 2021-08-20 13:54 UTC (permalink / raw)
To: ltp
Hi!
Thanks for the review, pushed.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-20 13:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-11 9:21 [LTP] [PATCH] tst_test_macros.h: Make TST_EXP_POSSITIVE() print TPASS as well Cyril Hrubis
2021-08-20 9:45 ` Petr Vorel
2021-08-20 13:54 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox