The testdriver was linked against the statically generated library of
libcoap. By this the testdriver will *always* find any symbols, no
matter if it is a private or public symbol.
Due this the testing behavior isn't the same as a user would use the
shared library and can get a potentially pitfall even if the testdriver
was successful.
Due previous changes to the public header the testdriver source needs
now the local header coap_config.h to find all needed functions so there
are small changes needed to the source files.
Some unit tests in tests/test_options.c and tests/test_pdu.c check
for error cases, causing warning messages to be emitted by the
library code. As the expected result is checked separately, the
warnings can be suppressed to avoid confusion.
Doing up some housekeeping around the used CFLAGS.
To be more generic put the default declaration for additional warning
CFLAGS into configure.ac and clean up the Makefile.am's.
There are the default CFLAGS variable that is a global variable if not
re adjusted inside the different targets.
The second variable for CFLAGS is the AM_CFLAGS definition that is used
inside a Makefile as a global variable.
There is also the possibility to graduate the CFLAGS for a single
target. But currently there are nothing more than one target within each
Makefile so we can set for now the target specific CFLAGS to the
AM_CFLAGS.
A new variable called WARNING_CFLAGS is inside the configure.ac created,
this variable holds all the warnings flags inside. The Makefile.am's are
taking the values and is setting the variable AM_CFLAGS which is used in
the target specific CFLAGS. Also the options 'DWITH_POSIX' and
'D_GNU_SOURCE' are now appended to the CFLAGS if the configure script is
detecting a *-[uc]linux* system.
To let the previous added configure option '--enable-tests' really build
the testdriver binary adding the needed changes to the files in the main
folder.
Finally adding a new Makefile.am within the tests/ folder.
The subdirectory "tests" now contains a growing set of unit tests for the
libcoap API. To use this, you will need CUnit (see http://cunit.sourceforge.net)
and must configure with the option --with-tests.