From f04cc474e314933f2c9f19cd89c13dd946492c36 Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Fri, 23 Feb 2024 08:48:13 +0100 Subject: [PATCH] common: an option to run all tests from command line (debbuger) Signed-off-by: Tomasz Gromadzki --- src/test/unittest/unittest.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/unittest/unittest.h b/src/test/unittest/unittest.h index a162667bb17..f865c2d07cc 100644 --- a/src/test/unittest/unittest.h +++ b/src/test/unittest/unittest.h @@ -624,6 +624,16 @@ TEST_CASE_PROCESS(int argc, char *argv[], if (argc < 2) UT_FATAL("usage: %s []", argv[0]); + if (strcmp("ALL", argv[1]) == 0) { + for (size_t i = 0; i < ntests; i++) { + int ret = test_cases[i].func(&test_cases[i], 0, NULL); + if (ret < 0) + UT_FATAL("Test %s return negative result", + test_cases[i].name); + } + return; + } + for (int i = 1; i < argc; i++) { char *str_test = argv[i]; const int args_off = i + 1;