From 62ef81891d3197bd6e4bcd387a39580c319b2026 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Tue, 27 Oct 2020 19:55:27 -0400 Subject: test: log: Convert log_test from python to C When rebasing this series I had to renumber all my log tests because someone made another log test in the meantime. This involved updaing a number in several places (C and python), and it wasn't checked by the compiler. So I though "how hard could it be to just rewrite in C?" And though it wasn't hard, it *was* tedious. Tests are numbered the same as before to allow for easier review. A note that if a test fails, everything after it will probably also fail. This is because that test won't clean up its filters. There's no easy way to do the cleanup, except perhaps removing all filters in a wrapper function. Signed-off-by: Sean Anderson --- include/test/log.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/test/log.h') diff --git a/include/test/log.h b/include/test/log.h index c661cde75a3..772e1978062 100644 --- a/include/test/log.h +++ b/include/test/log.h @@ -10,6 +10,8 @@ #include +#define LOGF_TEST (BIT(LOGF_FUNC) | BIT(LOGF_MSG)) + /* Declare a new logging test */ #define LOG_TEST(_name) UNIT_TEST(_name, 0, log_test) -- cgit v1.2.3 From 89723b94943663407f1c65cbff1f652f01a91311 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Tue, 27 Oct 2020 19:55:39 -0400 Subject: test: Add a test for log filter-* This exercises a few success and failure modes of the log filter-* commands. log filter-list is not tested because it's purely informational. I don't think there's a good way to test it except by testing if the output of the command exactly matches a sample run. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- include/test/log.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/test/log.h') diff --git a/include/test/log.h b/include/test/log.h index 772e1978062..e9028914500 100644 --- a/include/test/log.h +++ b/include/test/log.h @@ -14,5 +14,6 @@ /* Declare a new logging test */ #define LOG_TEST(_name) UNIT_TEST(_name, 0, log_test) +#define LOG_TEST_FLAGS(_name, _flags) UNIT_TEST(_name, _flags, log_test) #endif /* __TEST_LOG_H__ */ -- cgit v1.2.3