test: add --log option to display tests execution

When enabled (--log=1), shows test start, completion, and execution time.
This commit is contained in:
furszy
2025-09-09 11:02:05 -04:00
parent 95b9953ea4
commit 2f4546ce56
2 changed files with 32 additions and 5 deletions

View File

@@ -61,6 +61,7 @@ struct tf_test_module {
typedef int (*setup_ctx_fn)(void);
typedef int (*teardown_fn)(void);
typedef void (*run_test_fn)(const struct tf_test_entry*);
struct tf_targets {
/* Target tests indexes */
@@ -81,6 +82,8 @@ struct tf_args {
int list_tests;
/* Target tests indexes */
struct tf_targets targets;
/* Enable test execution logging */
int logging;
};
/* --------------------------------------------------------- */
@@ -99,6 +102,8 @@ struct tf_framework {
/* Specific context setup and teardown functions */
setup_ctx_fn fn_setup;
teardown_fn fn_teardown;
/* Test runner function (can be customized) */
run_test_fn fn_run_test;
};
/*