tests: add macro for generating function enter log message

The test-tpm2 test multiplexes a bunch of tests from a single
entrypoint test that creates the TPM2 connection. This means we only get
the nice log output which test we are looking for once for the
entrypoint.

Let's add a macro that allows it to nicely generate it for the inner
tests too and use it.
This commit is contained in:
Lennart Poettering
2023-11-13 16:50:55 +01:00
parent aa25e19b47
commit 47a7a4d404
2 changed files with 17 additions and 0 deletions
+3
View File
@@ -104,6 +104,9 @@ extern const TestFunc _weak_ __stop_SYSTEMD_TEST_TABLE[];
REGISTER_TEST(test_##name, ##__VA_ARGS__); \
static int test_##name(void)
#define TEST_LOG_FUNC() \
log_info("/* %s() */", __func__)
static inline int run_test_table(void) {
_cleanup_strv_free_ char **tests = NULL;
int r = EXIT_SUCCESS;