diff options
author | Vladimir Kobal <vlad@prokk.net> | 2019-10-15 15:15:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-15 15:15:40 +0300 |
commit | 16d40fbb14f29e51902434a5da69932c4b0353a0 (patch) | |
tree | a74e8306825cacd2672b60ed4ffc2908e47c2f72 /configure.ac | |
parent | 8a2f99238aacc7ba5429e3942870ccc1e897be3a (diff) |
Add CMocka unit tests (#6985)
* Add str2ld test
* Build test with Autotools
* Add storage_number test
* Configure tests in CMake
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index a966f0ea62..c35639adc2 100644 --- a/configure.ac +++ b/configure.ac @@ -1130,6 +1130,30 @@ AC_SUBST([OPTIONAL_PROMETHEUS_REMOTE_WRITE_LIBS]) AC_SUBST([OPTIONAL_MONGOC_CFLAGS]) AC_SUBST([OPTIONAL_MONGOC_LIBS]) +# ----------------------------------------------------------------------------- +# Check if cmocka is available - needed for unit testing + +AC_ARG_ENABLE( + [unit-tests], + [AS_HELP_STRING([--disable-unit-tests], + [Disables building and running the unit tests suite])], + [], + [enable_unit_tests="yes"] +) + +PKG_CHECK_MODULES( + [CMOCKA], [cmocka], + [have_cmocka="yes"], + [AC_MSG_WARN([cmocka.pc not found on the system. Unit tests disabled])] +) +AM_CONDITIONAL([ENABLE_UNITTESTS], [test "${enable_unit_tests}" = "yes" -a "${have_cmocka}" = "yes" ]) +AC_SUBST([ENABLE_UNITTESTS]) + +TEST_CFLAGS="${CFLAGS} ${CMOCKA_CFLAGS}" +TEST_LIBS="${CMOCKA_LIBS}" + +AC_SUBST([TEST_CFLAGS]) +AC_SUBST([TEST_LIBS]) AC_CONFIG_FILES([ Makefile @@ -1172,6 +1196,7 @@ AC_CONFIG_FILES([ health/Makefile health/notifications/Makefile libnetdata/Makefile + libnetdata/tests/Makefile libnetdata/adaptive_resortable_list/Makefile libnetdata/avl/Makefile libnetdata/buffer/Makefile @@ -1187,6 +1212,7 @@ AC_CONFIG_FILES([ libnetdata/socket/Makefile libnetdata/statistical/Makefile libnetdata/storage_number/Makefile + libnetdata/storage_number/tests/Makefile libnetdata/threads/Makefile libnetdata/url/Makefile libnetdata/json/Makefile |