Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
450
Issues
450
List
Boards
Labels
Service Desk
Milestones
Merge Requests
75
Merge Requests
75
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
Kea
Commits
38d091be
Commit
38d091be
authored
Aug 30, 2013
by
Marcin Siodelski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[3113] Fix hooks unit test failures when --enable-static-link is used.
parent
e66020fd
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
96 additions
and
108 deletions
+96
-108
src/bin/dhcp4/tests/Makefile.am
src/bin/dhcp4/tests/Makefile.am
+15
-5
src/bin/dhcp4/tests/test_libraries.h.in
src/bin/dhcp4/tests/test_libraries.h.in
+4
-16
src/bin/dhcp6/tests/Makefile.am
src/bin/dhcp6/tests/Makefile.am
+15
-5
src/bin/dhcp6/tests/test_libraries.h.in
src/bin/dhcp6/tests/test_libraries.h.in
+4
-18
src/lib/asiodns/Makefile.am
src/lib/asiodns/Makefile.am
+2
-1
src/lib/dhcpsrv/tests/Makefile.am
src/lib/dhcpsrv/tests/Makefile.am
+15
-9
src/lib/dhcpsrv/tests/test_libraries.h.in
src/lib/dhcpsrv/tests/test_libraries.h.in
+4
-18
src/lib/hooks/tests/Makefile.am
src/lib/hooks/tests/Makefile.am
+24
-6
src/lib/hooks/tests/test_libraries.h.in
src/lib/hooks/tests/test_libraries.h.in
+10
-29
src/lib/resolve/Makefile.am
src/lib/resolve/Makefile.am
+1
-0
src/lib/testutils/Makefile.am
src/lib/testutils/Makefile.am
+2
-1
No files found.
src/bin/dhcp4/tests/Makefile.am
View file @
38d091be
...
...
@@ -40,25 +40,35 @@ if USE_CLANGPP
AM_CXXFLAGS
+=
-Wno-unused-parameter
endif
if
USE_STATIC_LINK
AM_LDFLAGS
=
-static
endif
TESTS_ENVIRONMENT
=
\
$(LIBTOOL)
--mode
=
execute
$(VALGRIND_COMMAND)
TESTS
=
if
HAVE_GTEST
# Build shared libraries for testing.
# Build shared libraries for testing. The libtool way to create a shared library
# is to specify "-avoid-version -export-dynamic -module" in the library LDFLAGS
# (see http://www.gnu.org/software/libtool/manual/html_node/Link-mode.html).
# Use of these switches will guarantee that the .so files are created in the
# .libs folder and they can be dlopened.
# Note that the shared libraries with callouts should not be used together with
# the --enable-static-link option. With this option, the bind10 libraries are
# statically linked with the program and if the callout invokes the methods
# which belong to these libraries, the library with the callout will get its
# own copy of the static objects (e.g. logger, ServerHooks) and that will lead
# to unexpected errors. For this reason, the --enable-static-link option is
# ignored for unit tests built here.
lib_LTLIBRARIES
=
libco1.la libco2.la
libco1_la_SOURCES
=
callout_library_1.cc callout_library_common.h
libco1_la_CXXFLAGS
=
$(AM_CXXFLAGS)
libco1_la_CPPFLAGS
=
$(AM_CPPFLAGS)
libco1_la_LDFLAGS
=
-avoid-version
-export-dynamic
-module
libco2_la_SOURCES
=
callout_library_2.cc callout_library_common.h
libco2_la_CXXFLAGS
=
$(AM_CXXFLAGS)
libco2_la_CPPFLAGS
=
$(AM_CPPFLAGS)
libco2_la_LDFLAGS
=
-avoid-version
-export-dynamic
-module
TESTS
+=
dhcp4_unittests
...
...
src/bin/dhcp4/tests/test_libraries.h.in
View file @
38d091be
...
...
@@ -19,32 +19,20 @@
namespace {
// Take care of differences in DLL naming between operating systems.
#ifdef OS_OSX
#define DLL_SUFFIX ".dylib"
#else
#define DLL_SUFFIX ".so"
#endif
// Names of the libraries used in these tests. These libraries are built using
// libtool, so we need to look in the hidden ".libs" directory to locate the
// shared library.
// Library with load/unload functions creating marker files to check their
// operation.
const char* const CALLOUT_LIBRARY_1 = "@abs_builddir@/.libs/libco1"
DLL_SUFFIX;
const char* const CALLOUT_LIBRARY_2 = "@abs_builddir@/.libs/libco2"
DLL_SUFFIX;
const char* const CALLOUT_LIBRARY_1 = "@abs_builddir@/.libs/libco1.so";
const char* const CALLOUT_LIBRARY_2 = "@abs_builddir@/.libs/libco2.so";
// Name of a library which is not present.
const char* const NOT_PRESENT_LIBRARY = "@abs_builddir@/.libs/libnothere
"
DLL_SUFFIX;
const char* const NOT_PRESENT_LIBRARY = "@abs_builddir@/.libs/libnothere
.so";
} // anonymous namespace
...
...
src/bin/dhcp6/tests/Makefile.am
View file @
38d091be
...
...
@@ -36,25 +36,35 @@ if USE_CLANGPP
AM_CXXFLAGS
+=
-Wno-unused-parameter
endif
if
USE_STATIC_LINK
AM_LDFLAGS
=
-static
endif
TESTS_ENVIRONMENT
=
\
$(LIBTOOL)
--mode
=
execute
$(VALGRIND_COMMAND)
TESTS
=
if
HAVE_GTEST
# Build shared libraries for testing.
# Build shared libraries for testing. The libtool way to create a shared library
# is to specify "-avoid-version -export-dynamic -module" in the library LDFLAGS
# (see http://www.gnu.org/software/libtool/manual/html_node/Link-mode.html).
# Use of these switches will guarantee that the .so files are created in the
# .libs folder and they can be dlopened.
# Note that the shared libraries with callouts should not be used together with
# the --enable-static-link option. With this option, the bind10 libraries are
# statically linked with the program and if the callout invokes the methods
# which belong to these libraries, the library with the callout will get its
# own copy of the static objects (e.g. logger, ServerHooks) and that will lead
# to unexpected errors. For this reason, the --enable-static-link option is
# ignored for unit tests built here.
lib_LTLIBRARIES
=
libco1.la libco2.la
libco1_la_SOURCES
=
callout_library_1.cc callout_library_common.h
libco1_la_CXXFLAGS
=
$(AM_CXXFLAGS)
libco1_la_CPPFLAGS
=
$(AM_CPPFLAGS)
libco1_la_LDFLAGS
=
-avoid-version
-export-dynamic
-module
libco2_la_SOURCES
=
callout_library_2.cc callout_library_common.h
libco2_la_CXXFLAGS
=
$(AM_CXXFLAGS)
libco2_la_CPPFLAGS
=
$(AM_CPPFLAGS)
libco2_la_LDFLAGS
=
-avoid-version
-export-dynamic
-module
TESTS
+=
dhcp6_unittests
dhcp6_unittests_SOURCES
=
dhcp6_unittests.cc
...
...
src/bin/dhcp6/tests/test_libraries.h.in
View file @
38d091be
...
...
@@ -19,32 +19,18 @@
namespace {
// Take care of differences in DLL naming between operating systems.
#ifdef OS_OSX
#define DLL_SUFFIX ".dylib"
#else
#define DLL_SUFFIX ".so"
#endif
// Names of the libraries used in these tests. These libraries are built using
// libtool, so we need to look in the hidden ".libs" directory to locate the
// shared library.
// Library with load/unload functions creating marker files to check their
// operation.
const char* const CALLOUT_LIBRARY_1 = "@abs_builddir@/.libs/libco1"
DLL_SUFFIX;
const char* const CALLOUT_LIBRARY_2 = "@abs_builddir@/.libs/libco2"
DLL_SUFFIX;
const char* const CALLOUT_LIBRARY_1 = "@abs_builddir@/.libs/libco1.so";
const char* const CALLOUT_LIBRARY_2 = "@abs_builddir@/.libs/libco2.so";
// Name of a library which is not present.
const char* const NOT_PRESENT_LIBRARY = "@abs_builddir@/.libs/libnothere
"
DLL_SUFFIX;
const char* const NOT_PRESENT_LIBRARY = "@abs_builddir@/.libs/libnothere
.so";
} // anonymous namespace
...
...
src/lib/asiodns/Makefile.am
View file @
38d091be
...
...
@@ -40,4 +40,5 @@ if USE_CLANGPP
libb10_asiodns_la_CXXFLAGS
+=
-Wno-error
endif
libb10_asiodns_la_CPPFLAGS
=
$(AM_CPPFLAGS)
libb10_asiodns_la_LIBADD
=
$(top_builddir)
/src/lib/log/libb10-log.la
libb10_asiodns_la_LIBADD
=
$(top_builddir)
/src/lib/asiolink/libb10-asiolink.la
libb10_asiodns_la_LIBADD
+=
$(top_builddir)
/src/lib/log/libb10-log.la
src/lib/dhcpsrv/tests/Makefile.am
View file @
38d091be
...
...
@@ -13,11 +13,6 @@ AM_CXXFLAGS = $(B10_CXXFLAGS)
# But older GCC compilers don't have the flag.
AM_CXXFLAGS
+=
$(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)
if
USE_STATIC_LINK
AM_LDFLAGS
=
-static
TEST_LIBS_LDFLAGS
=
-Bshareable
endif
CLEANFILES
=
*
.gcno
*
.gcda
TESTS_ENVIRONMENT
=
\
...
...
@@ -25,19 +20,30 @@ TESTS_ENVIRONMENT = \
TESTS
=
if
HAVE_GTEST
# Build shared libraries for testing.
# Build shared libraries for testing. The libtool way to create a shared library
# is to specify "-avoid-version -export-dynamic -module" in the library LDFLAGS
# (see http://www.gnu.org/software/libtool/manual/html_node/Link-mode.html).
# Use of these switches will guarantee that the .so files are created in the
# .libs folder and they can be dlopened.
# Note that the shared libraries with callouts should not be used together with
# the --enable-static-link option. With this option, the bind10 libraries are
# statically linked with the program and if the callout invokes the methods
# which belong to these libraries, the library with the callout will get its
# own copy of the static objects (e.g. logger, ServerHooks) and that will lead
# to unexpected errors. For this reason, the --enable-static-link option is
# ignored for unit tests built here.
lib_LTLIBRARIES
=
libco1.la libco2.la
libco1_la_SOURCES
=
callout_library.cc
libco1_la_CXXFLAGS
=
$(AM_CXXFLAGS)
libco1_la_CPPFLAGS
=
$(AM_CPPFLAGS)
$(LOG4CPLUS_INCLUDES)
libco1_la_LDFLAGS
=
$(TEST_LIBS_LDFLAGS)
libco1_la_LDFLAGS
=
-avoid-version
-export-dynamic
-module
libco2_la_SOURCES
=
callout_library.cc
libco2_la_CXXFLAGS
=
$(AM_CXXFLAGS)
libco2_la_CPPFLAGS
=
$(AM_CPPFLAGS)
$(LOG4CPLUS_INCLUDES)
libco2_la_LDFLAGS
=
$(TEST_LIBS_LDFLAGS)
libco2_la_LDFLAGS
=
-avoid-version
-export-dynamic
-module
TESTS
+=
libdhcpsrv_unittests
...
...
src/lib/dhcpsrv/tests/test_libraries.h.in
View file @
38d091be
...
...
@@ -19,32 +19,18 @@
namespace {
// Take care of differences in DLL naming between operating systems.
#ifdef OS_OSX
#define DLL_SUFFIX ".dylib"
#else
#define DLL_SUFFIX ".so"
#endif
// Names of the libraries used in these tests. These libraries are built using
// libtool, so we need to look in the hidden ".libs" directory to locate the
// shared library.
// Library with load/unload functions creating marker files to check their
// operation.
static const char* CALLOUT_LIBRARY_1 = "@abs_builddir@/.libs/libco1"
DLL_SUFFIX;
static const char* CALLOUT_LIBRARY_2 = "@abs_builddir@/.libs/libco2"
DLL_SUFFIX;
static const char* CALLOUT_LIBRARY_1 = "@abs_builddir@/.libs/libco1.so";
static const char* CALLOUT_LIBRARY_2 = "@abs_builddir@/.libs/libco2.so";
// Name of a library which is not present.
static const char* NOT_PRESENT_LIBRARY = "@abs_builddir@/.libs/libnothere
"
DLL_SUFFIX;
static const char* NOT_PRESENT_LIBRARY = "@abs_builddir@/.libs/libnothere
.so";
} // anonymous namespace
...
...
src/lib/hooks/tests/Makefile.am
View file @
38d091be
...
...
@@ -22,7 +22,19 @@ TESTS_ENVIRONMENT = \
TESTS
=
if
HAVE_GTEST
# Build shared libraries for testing.
# Build shared libraries for testing. The libtool way to create a shared library
# is to specify "-avoid-version -export-dynamic -module" in the library LDFLAGS
# (see http://www.gnu.org/software/libtool/manual/html_node/Link-mode.html).
# Use of these switches will guarantee that the .so files are created in the
# .libs folder and they can be dlopened.
# Note that the shared libraries with callouts should not be used together with
# the --enable-static-link option. With this option, the bind10 libraries are
# statically linked with the program and if the callout invokes the methods
# which belong to these libraries, the library with the callout will get its
# own copy of the static objects (e.g. logger, ServerHooks) and that will lead
# to unexpected errors. For this reason, the --enable-static-link option is
# ignored for unit tests built here.
lib_LTLIBRARIES
=
libnvl.la libivl.la libfxl.la libbcl.la liblcl.la liblecl.la
\
libucl.la libfcl.la
...
...
@@ -30,43 +42,53 @@ lib_LTLIBRARIES = libnvl.la libivl.la libfxl.la libbcl.la liblcl.la liblecl.la \
libnvl_la_SOURCES
=
no_version_library.cc
libnvl_la_CXXFLAGS
=
$(AM_CXXFLAGS)
libnvl_la_CPPFLAGS
=
$(AM_CPPFLAGS)
$(LOG4CPLUS_INCLUDES)
libnvl_la_LDFLAGS
=
-avoid-version
-export-dynamic
-module
# Incorrect version function
libivl_la_SOURCES
=
incorrect_version_library.cc
libivl_la_CXXFLAGS
=
$(AM_CXXFLAGS)
libivl_la_CPPFLAGS
=
$(AM_CPPFLAGS)
$(LOG4CPLUS_INCLUDES)
libivl_la_LDFLAGS
=
-avoid-version
-export-dynamic
-module
# All framework functions throw an exception
libfxl_la_SOURCES
=
framework_exception_library.cc
libfxl_la_CXXFLAGS
=
$(AM_CXXFLAGS)
libfxl_la_CPPFLAGS
=
$(AM_CPPFLAGS)
$(LOG4CPLUS_INCLUDES)
libfxl_la_LDFLAGS
=
-avoid-version
-export-dynamic
-module
# The basic callout library - contains standard callouts
libbcl_la_SOURCES
=
basic_callout_library.cc
libbcl_la_CXXFLAGS
=
$(AM_CXXFLAGS)
libbcl_la_CPPFLAGS
=
$(AM_CPPFLAGS)
$(LOG4CPLUS_INCLUDES)
libbcl_la_LDFLAGS
=
-avoid-version
-export-dynamic
-module
# The load callout library - contains a load function
liblcl_la_SOURCES
=
load_callout_library.cc
liblcl_la_CXXFLAGS
=
$(AM_CXXFLAGS)
liblcl_la_CPPFLAGS
=
$(AM_CPPFLAGS)
$(LOG4CPLUS_INCLUDES)
liblcl_la_LDFLAGS
=
-avoid-version
-export-dynamic
-module
# The load error callout library - contains a load function that returns
# an error.
liblecl_la_SOURCES
=
load_error_callout_library.cc
liblecl_la_CXXFLAGS
=
$(AM_CXXFLAGS)
liblecl_la_CPPFLAGS
=
$(AM_CPPFLAGS)
$(LOG4CPLUS_INCLUDES)
liblecl_la_LDFLAGS
=
-avoid-version
-export-dynamic
-module
# The unload callout library - contains an unload function that
# creates a marker file.
libucl_la_SOURCES
=
unload_callout_library.cc
libucl_la_CXXFLAGS
=
$(AM_CXXFLAGS)
libucl_la_CPPFLAGS
=
$(AM_CPPFLAGS)
$(LOG4CPLUS_INCLUDES)
libucl_la_LDFLAGS
=
-avoid-version
-export-dynamic
-module
# The full callout library - contains all three framework functions.
libfcl_la_SOURCES
=
full_callout_library.cc
libfcl_la_CXXFLAGS
=
$(AM_CXXFLAGS)
libfcl_la_CPPFLAGS
=
$(AM_CPPFLAGS)
$(LOG4CPLUS_INCLUDES)
libfcl_la_LDFLAGS
=
-avoid-version
-export-dynamic
-module
-Bstatic
$(top_builddir)
/src/lib/exceptions/libb10-exceptions.la
-Bstatic
$(top_builddir)
/src/lib/hooks/libb10-hooks.la
libfcl_la_LIBADD
=
$(top_builddir)
/src/lib/exceptions/libb10-exceptions.la
libfcl_la_LIBADD
+=
$(top_builddir)
/src/lib/hooks/libb10-hooks.la
TESTS
+=
run_unittests
run_unittests_SOURCES
=
run_unittests.cc
...
...
@@ -83,12 +105,8 @@ nodist_run_unittests_SOURCES = marker_file.h
nodist_run_unittests_SOURCES
+=
test_libraries.h
run_unittests_CPPFLAGS
=
$(AM_CPPFLAGS)
$(GTEST_INCLUDES)
run_unittests_LDFLAGS
=
$(AM_LDFLAGS)
$(GTEST_LDFLAGS)
if
USE_STATIC_LINK
# If specified, only link unit tests static - the test libraries must be
# build as shared libraries.
run_unittests_LDFLAGS
+=
-static
endif
run_unittests_LDADD
=
$(AM_LDADD)
$(GTEST_LDADD)
...
...
src/lib/hooks/tests/test_libraries.h.in
View file @
38d091be
...
...
@@ -19,60 +19,41 @@
namespace {
// Take care of differences in DLL naming between operating systems.
#ifdef OS_OSX
#define DLL_SUFFIX ".dylib"
#else
#define DLL_SUFFIX ".so"
#endif
// Names of the libraries used in these tests. These libraries are built using
// libtool, so we need to look in the hidden ".libs" directory to locate the
// .so file. Note that we access the .so file - libtool creates this as a
// like to the real shared library.
// Basic library with context_create and three "standard" callouts.
static const char* BASIC_CALLOUT_LIBRARY = "@abs_builddir@/.libs/libbcl"
DLL_SUFFIX;
static const char* BASIC_CALLOUT_LIBRARY = "@abs_builddir@/.libs/libbcl.so";
// Library with context_create and three "standard" callouts, as well as
// load() and unload() functions.
static const char* FULL_CALLOUT_LIBRARY = "@abs_builddir@/.libs/libfcl"
DLL_SUFFIX;
static const char* FULL_CALLOUT_LIBRARY = "@abs_builddir@/.libs/libfcl.so";
// Library where the all framework functions throw an exception
static const char* FRAMEWORK_EXCEPTION_LIBRARY = "@abs_builddir@/.libs/libfxl"
DLL_SUFFIX;
static const char* FRAMEWORK_EXCEPTION_LIBRARY = "@abs_builddir@/.libs/libfxl.so";
// Library where the version() function returns an incorrect result.
static const char* INCORRECT_VERSION_LIBRARY = "@abs_builddir@/.libs/libivl"
DLL_SUFFIX;
static const char* INCORRECT_VERSION_LIBRARY = "@abs_builddir@/.libs/libivl.so";
// Library where some of the callout registration is done with the load()
// function.
static const char* LOAD_CALLOUT_LIBRARY = "@abs_builddir@/.libs/liblcl"
DLL_SUFFIX;
static const char* LOAD_CALLOUT_LIBRARY = "@abs_builddir@/.libs/liblcl.so";
// Library where the load() function returns an error.
static const char* LOAD_ERROR_CALLOUT_LIBRARY =
"@abs_builddir@/.libs/liblecl
" DLL_SUFFIX
;
"@abs_builddir@/.libs/liblecl
.so"
;
// Name of a library which is not present.
static const char* NOT_PRESENT_LIBRARY = "@abs_builddir@/.libs/libnothere"
DLL_SUFFIX;
static const char* NOT_PRESENT_LIBRARY = "@abs_builddir@/.libs/libnothere.so";
// Library that does not include a version function.
static const char* NO_VERSION_LIBRARY = "@abs_builddir@/.libs/libnvl"
DLL_SUFFIX;
static const char* NO_VERSION_LIBRARY = "@abs_builddir@/.libs/libnvl.so";
// Library where there is an unload() function.
static const char* UNLOAD_CALLOUT_LIBRARY = "@abs_builddir@/.libs/libucl
"
DLL_SUFFIX;
static const char* UNLOAD_CALLOUT_LIBRARY = "@abs_builddir@/.libs/libucl
.so";
} // anonymous namespace
...
...
src/lib/resolve/Makefile.am
View file @
38d091be
...
...
@@ -35,6 +35,7 @@ libb10_resolve_la_LIBADD = $(top_builddir)/src/lib/dns/libb10-dns++.la
libb10_resolve_la_LIBADD
+=
$(top_builddir)
/src/lib/exceptions/libb10-exceptions.la
libb10_resolve_la_LIBADD
+=
$(top_builddir)
/src/lib/log/libb10-log.la
libb10_resolve_la_LIBADD
+=
$(top_builddir)
/src/lib/asiodns/libb10-asiodns.la
libb10_resolve_la_LIBADD
+=
$(top_builddir)
/src/lib/nsas/libb10-nsas.la
# The message file should be in the distribution.
EXTRA_DIST
=
resolve_messages.mes
...
...
src/lib/testutils/Makefile.am
View file @
38d091be
...
...
@@ -11,7 +11,8 @@ libb10_testutils_la_SOURCES = srv_test.h srv_test.cc
libb10_testutils_la_SOURCES
+=
dnsmessage_test.h dnsmessage_test.cc
libb10_testutils_la_SOURCES
+=
mockups.h
libb10_testutils_la_CPPFLAGS
=
$(AM_CPPFLAGS)
$(GTEST_INCLUDES)
libb10_testutils_la_LIBADD
=
$(top_builddir)
/src/lib/asiolink/libb10-asiolink.la
libb10_testutils_la_LIBADD
=
$(top_builddir)
/src/lib/asiolink/libb10-asiolink.la
libb10_testutils_la_LIBADD
+=
$(top_builddir)
/src/lib/dns/libb10-dns++.la
endif
EXTRA_DIST
=
portconfig.h socket_request.h
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment