From f3061020805506ff46480cef66872b2ef5b3c13c Mon Sep 17 00:00:00 2001 From: Valtteri Koskivuori Date: Mon, 5 Feb 2024 00:00:38 +0200 Subject: [PATCH] tests: Handle loglevel flag in testrunner Useful when manually running individual test cases with verbose logging. --- tests/testrunner.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/testrunner.c b/tests/testrunner.c index 554f0104..15f3e03f 100644 --- a/tests/testrunner.c +++ b/tests/testrunner.c @@ -152,6 +152,12 @@ int getPerfTestCount(char *suite) { int main(int argc, char *argv[]) { struct driver_args *args = args_parse(argc, argv); + char *log_level = args_string(args, "log_level"); + if (stringEquals(log_level, "debug")) { + cr_log_level_set(Debug); + } else if (stringEquals(log_level, "spam")) { + cr_log_level_set(Spam); + } int ret = 0; if (args_is_set(args, "runTests") || args_is_set(args, "runPerfTests")) { char *suite = args_string(args, "test_suite");