Skip to content

Commit

Permalink
Merge pull request #525 from mrdeep1/testdriver
Browse files Browse the repository at this point in the history
testdriver: Add in support for access to libcoap internal functions
  • Loading branch information
obgm authored Jul 23, 2020
2 parents 65041c9 + b1245a9 commit b373aec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ AC_SUBST([DOLLAR_SIGN],[$])
# __tests__
AC_ARG_ENABLE([tests],
[AS_HELP_STRING([--enable-tests],
[Enable building the binary testsuite [default=no]])],
[Enable building the binary testsuite. Requires --enable-static [default=no]])],
[build_tests="$enableval"],
[build_tests="no"])

Expand All @@ -573,6 +573,10 @@ if test "x$build_tests" = "xyes"; then
AC_MSG_WARN([==> You want to build the testing binary but the pkg-config file cunit.pc could not be found or installed CUnit version is too old!])
AC_MSG_ERROR([==> Install the package(s) that contains the development files for CUnit or disable the testing binary using '--disable-tests'.])
])
if test "x$enable_static" = "xno"; then
enable_static=yes
AC_MSG_WARN([--enable-tests requires --enable-static which is now enabled.])
fi
fi
AM_CONDITIONAL(HAVE_CUNIT, [test "x$CUNIT_LIBS" != "x"])

Expand Down
4 changes: 3 additions & 1 deletion tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ testdriver_SOURCES = \
test_wellknown.c \
test_tls.c

testdriver_LDADD = $(CUNIT_LIBS) $(DTLS_LIBS) $(top_builddir)/.libs/libcoap-$(LIBCOAP_NAME_SUFFIX).la
# The .a file is uses instead of .la so that testdriver can always access the
# internal functions that are not globaly exposed in a .so file.
testdriver_LDADD = $(CUNIT_LIBS) $(top_builddir)/.libs/libcoap-$(LIBCOAP_NAME_SUFFIX).a ${DTLS_LIBS}

# If there is a API change to something $(LIBCOAP_API_VERSION) > 1 there is
# nothing to adopt here. No needed to implement something here because the test
Expand Down

0 comments on commit b373aec

Please sign in to comment.