diff mbox series

[v15,05/11] app/test: skip two logs_autotest cases on Windows

Message ID 1643173844-27341-6-git-send-email-jizh@linux.microsoft.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show
Series app/test: enable subset of tests on Windows | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Jie Zhou Jan. 26, 2022, 5:10 a.m. UTC
DPDK logs_autotest on Windows failed at "dynamic log types" tests.
The failures are on 2 test cases for rte_log_set_level_regexp API,
due to regular expression is not supported on Windows in DPDK yet
and regcomp/regexec are just stubs on Windows (in regex.h).

In app\test\test_logs.c, ifndef these two test cases, and for the
rte_log_set_level_pattern validation case following these two cases,
differentiate the expected log level passed into macro CHECK_LEVELS

Now logs_autotest completes for all dynamic log types and static log types.

Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
 app/test/test_logs.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Thomas Monjalon Feb. 8, 2022, 9:49 a.m. UTC | #1
26/01/2022 06:10, Jie Zhou:
> --- a/app/test/test_logs.c
> +++ b/app/test/test_logs.c
> @@ -121,7 +122,10 @@ test_logs(void)
>  
>  	rte_log_set_level_pattern("logtype", RTE_LOG_DEBUG);
>  	CHECK_LEVELS(RTE_LOG_ERR, RTE_LOG_EMERG, RTE_LOG_EMERG);
> -
> +#else
> +	ret = rte_log_set_level_pattern("logtype", RTE_LOG_DEBUG);
> +	CHECK_LEVELS(RTE_LOG_ERR, RTE_LOG_INFO, RTE_LOG_ERR);
> +#endif

ret is not used, I'll remove it.
diff mbox series

Patch

diff --git a/app/test/test_logs.c b/app/test/test_logs.c
index 7abb6eeca2..7c001c1ab3 100644
--- a/app/test/test_logs.c
+++ b/app/test/test_logs.c
@@ -113,6 +113,7 @@  test_logs(void)
 	rte_log_set_level(logtype1, RTE_LOG_ERR);
 	CHECK_LEVELS(RTE_LOG_ERR, RTE_LOG_INFO, RTE_LOG_ERR);
 
+#ifndef RTE_EXEC_ENV_WINDOWS
 	rte_log_set_level_regexp("type$", RTE_LOG_EMERG);
 	CHECK_LEVELS(RTE_LOG_ERR, RTE_LOG_INFO, RTE_LOG_ERR);
 
@@ -121,7 +122,10 @@  test_logs(void)
 
 	rte_log_set_level_pattern("logtype", RTE_LOG_DEBUG);
 	CHECK_LEVELS(RTE_LOG_ERR, RTE_LOG_EMERG, RTE_LOG_EMERG);
-
+#else
+	ret = rte_log_set_level_pattern("logtype", RTE_LOG_DEBUG);
+	CHECK_LEVELS(RTE_LOG_ERR, RTE_LOG_INFO, RTE_LOG_ERR);
+#endif
 	/* set logtype level low to so we can test global level */
 	rte_log_set_level_pattern("logtype*", RTE_LOG_DEBUG);
 	CHECK_LEVELS(RTE_LOG_DEBUG, RTE_LOG_DEBUG, RTE_LOG_DEBUG);