From 4f6ece81b8ce2bfc495fdb8bb6544a01685e2f69 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 18 Mar 2021 10:27:27 +0100 Subject: [PATCH] Add functions to unittests library --- bacula/src/lib/unittests.c | 12 ++++++++++++ bacula/src/lib/unittests.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/bacula/src/lib/unittests.c b/bacula/src/lib/unittests.c index 6530c5960..c6351c909 100644 --- a/bacula/src/lib/unittests.c +++ b/bacula/src/lib/unittests.c @@ -77,6 +77,18 @@ void configure_test(uint64_t options) } } +/* Get the total number of tests */ +int unittest_get_nb_tests() +{ + return nb; +} + +/* Get the total number of tests in error */ +int unittest_get_nb_errors() +{ + return err; +} + /* * Test success if value is not zero. */ diff --git a/bacula/src/lib/unittests.h b/bacula/src/lib/unittests.h index 7c1ff4797..5b2f3a9df 100644 --- a/bacula/src/lib/unittests.h +++ b/bacula/src/lib/unittests.h @@ -61,6 +61,8 @@ int report(); void terminate(int sig); void prolog(const char *name, bool lmgr=false, bool motd=true); void epilog(); +int unittest_get_nb_tests(); +int unittest_get_nb_errors(); /* The class based approach for C++ geeks */ class Unittests -- 2.47.3