2
2
# #
3
3
# # Copyright (c) 2017-2020, Intel Corporation
4
4
5
- # # @todo Do not add the EXECUTABLE_* flags to test libraries (if any).
6
- AM_CPPFLAGS = -I$(top_srcdir ) /include -I$(top_builddir ) /include
7
- AM_CFLAGS = $(ELL_CFLAGS ) $(EXECUTABLE_CFLAGS )
8
- AM_LDFLAGS = $(EXECUTABLE_LDFLAGS )
9
-
10
- # # Convenience library that contains utility functions used by the
11
- # # mptcpd tests.
12
- noinst_LTLIBRARIES = libmptcpd_test.la
13
-
14
- libmptcpd_test_la_SOURCES = call_count.c call_plugin.c sockaddr.c
15
- libmptcpd_test_la_CPPFLAGS = \
16
- $(CODE_COVERAGE_CPPFLAGS ) $(AM_CPPFLAGS )
17
- libmptcpd_test_la_CFLAGS = $(ELL_CFLAGS ) $(CODE_COVERAGE_CFLAGS )
18
- libmptcpd_test_la_LIBADD = $(ELL_LIBS ) $(CODE_COVERAGE_LIBS )
19
-
20
- # # Build a test mptcpd plugin.
21
- # #
22
- # # "check_LTLIBRARIES" can't be used here since a dynamically loadable
23
- # # module will not be built. A Libtool convenience library would be
24
- # # built instead.
25
- # #
26
- # # Absolute path needed by Libtool during installation.
27
- plugin_adir = $(abs_builddir ) /plugins_a
28
- plugin_bdir = $(abs_builddir ) /plugins_b
29
- plugin_noopdir = $(abs_builddir ) /plugins_noop
30
-
31
- # # For testing mptcpd plugin framework when default plugin is
32
- # # explicitly specified, as well as plugin security checks.
33
- plugin_a_LTLIBRARIES = plugin_three.la plugin_four.la
34
-
35
- # # For testing mptcpd plugin framework when default plugin is
36
- # # is the first registered plugin, i.e. the one with the *lowest*
37
- # # plugin priority, as well as testing plugin operation dispatch.
38
- plugin_b_LTLIBRARIES = plugin_one.la plugin_two.la
39
-
40
- # # For mptcpd tests that require a plugin without testing the plugin
41
- # # itself. The plugin will be a no-op in this case.
42
- plugin_noop_LTLIBRARIES = plugin_noop.la
43
-
44
- TEST_PLUGIN_DIR_A = $(DESTDIR )$(plugin_adir )
45
- TEST_PLUGIN_DIR_B = $(DESTDIR )$(plugin_bdir )
46
- TEST_PLUGIN_DIR_NOOP = $(DESTDIR )$(plugin_noopdir )
47
-
48
- # # List of test plugin directory for use as dependencies for test
49
- # # plugin installation.
50
- TEST_PLUGIN_DIRS = \
51
- $(TEST_PLUGIN_DIR_A ) \
52
- $(TEST_PLUGIN_DIR_B ) \
53
- $(TEST_PLUGIN_DIR_NOOP )
54
-
55
- # # Plugin names
56
- TEST_PLUGIN_ONE = plugin_one
57
- TEST_PLUGIN_TWO = plugin_two
58
- TEST_PLUGIN_THREE = plugin_three
59
- TEST_PLUGIN_FOUR = plugin_four
60
- TEST_PLUGIN_NOOP = plugin_noop
61
-
62
- # # libmptcpd hasn't been installed yet, so directly link to the
63
- # # library in its build directory so that dynamic linker can find it
64
- # # when relinking the "installed" test plugin binaries.
65
- PLUGIN_LIBMPTCPD_FLAGS = -L$(abs_top_builddir ) /lib/.libs -lmptcpd
5
+ include $(top_srcdir ) /aminclude_static.am
66
6
67
- plugin_one_la_SOURCES = plugin_one.c
68
- plugin_one_la_CPPFLAGS = \
69
- $(AM_CPPFLAGS ) \
70
- -DTEST_PLUGIN=\"$(TEST_PLUGIN_ONE ) \"
71
- plugin_one_la_CFLAGS = $(ELL_CFLAGS )
72
- plugin_one_la_LDFLAGS = -no-undefined -module -avoid-version $(ELL_LIBS )
73
- plugin_one_la_LIBADD = $(PLUGIN_LIBMPTCPD_FLAGS ) libmptcpd_test.la
7
+ SUBDIRS = lib plugins
74
8
75
- plugin_two_la_SOURCES = plugin_two.c
76
- plugin_two_la_CPPFLAGS = \
77
- $(AM_CPPFLAGS ) \
78
- -DTEST_PLUGIN=\"$(TEST_PLUGIN_TWO ) \"
79
- plugin_two_la_CFLAGS = $(ELL_CFLAGS )
80
- plugin_two_la_LDFLAGS = -no-undefined -module -avoid-version $(ELL_LIBS )
81
- plugin_two_la_LIBADD = $(PLUGIN_LIBMPTCPD_FLAGS ) libmptcpd_test.la
82
-
83
- plugin_three_la_SOURCES = plugin_three.c
84
- plugin_three_la_CPPFLAGS = \
85
- $(AM_CPPFLAGS ) \
86
- -DTEST_PLUGIN=\"$(TEST_PLUGIN_THREE ) \"
87
- plugin_three_la_CFLAGS = $(ELL_CFLAGS )
88
- plugin_three_la_LDFLAGS = -no-undefined -module -avoid-version $(ELL_LIBS )
89
- plugin_three_la_LIBADD = $(PLUGIN_LIBMPTCPD_FLAGS ) libmptcpd_test.la
90
-
91
- plugin_four_la_SOURCES = plugin_four.c
92
- plugin_four_la_CPPFLAGS = \
93
- $(AM_CPPFLAGS ) \
94
- -DTEST_PLUGIN=\"$(TEST_PLUGIN_FOUR ) \"
95
- plugin_four_la_CFLAGS = $(ELL_CFLAGS )
96
- plugin_four_la_LDFLAGS = \
97
- -no-undefined -module -avoid-version $(ELL_LIBS )
98
- plugin_four_la_LIBADD = $(PLUGIN_LIBMPTCPD_FLAGS ) libmptcpd_test.la
99
-
100
- plugin_noop_la_SOURCES = plugin_noop.c
101
- plugin_noop_la_CPPFLAGS = \
102
- $(AM_CPPFLAGS ) \
103
- -DTEST_PLUGIN=\"$(TEST_PLUGIN_NOOP ) \"
104
- plugin_noop_la_CFLAGS = $(ELL_CFLAGS )
105
- plugin_noop_la_LDFLAGS = \
106
- -no-undefined -module -avoid-version $(ELL_LIBS )
107
- plugin_noop_la_LIBADD = $(PLUGIN_LIBMPTCPD_FLAGS )
108
-
109
- # # List of test plugin sources for use as dependencies for test plugin
110
- # # installation.
111
- TEST_PLUGIN_SOURCE_FILES = \
112
- $(plugin_one_la_SOURCES ) \
113
- $(plugin_two_la_SOURCES ) \
114
- $(plugin_three_la_SOURCES ) \
115
- $(plugin_four_la_SOURCES ) \
116
- $(plugin_noop_la_SOURCES )
9
+ # # @todo Do not add the EXECUTABLE_* flags to test libraries (if any).
10
+ AM_CPPFLAGS = \
11
+ -I$(top_srcdir ) /include \
12
+ -I$(top_builddir ) /include \
13
+ -I$(srcdir ) /lib \
14
+ $(CODE_COVERAGE_CPPFLAGS )
15
+ AM_CFLAGS = $(ELL_CFLAGS ) $(EXECUTABLE_CFLAGS ) $(CODE_COVERAGE_CFLAGS )
16
+ AM_CXXFLAGS = $(ELL_CFLAGS ) $(EXECUTABLE_CFLAGS ) $(CODE_COVERAGE_CXXFLAGS )
17
+ AM_LDFLAGS = $(EXECUTABLE_LDFLAGS )
117
18
118
- check_HEADERS = test-plugin.h
19
+ TEST_PLUGIN_DIR_SECURITY = $(abs_builddir ) /plugins/security/.libs
20
+ TEST_PLUGIN_DIR_PRIORITY = $(abs_builddir ) /plugins/priority/.libs
21
+ TEST_PLUGIN_DIR_NOOP = $(abs_builddir ) /plugins/noop/.libs
119
22
120
23
check_PROGRAMS = \
121
24
test-plugin \
@@ -137,22 +40,26 @@ xfail_test_scripts = \
137
40
dist_check_SCRIPTS = test-start-stop $(xfail_test_scripts )
138
41
139
42
test_plugin_SOURCES = test-plugin.c
140
- test_plugin_CPPFLAGS = \
141
- $(AM_CPPFLAGS ) \
142
- -D_POSIX_C_SOURCE=200809L \
143
- -DTEST_PLUGIN_DIR_A =\"$(TEST_PLUGIN_DIR_A ) \" \
144
- -DTEST_PLUGIN_DIR_B =\"$(TEST_PLUGIN_DIR_B ) \" \
145
- -DTEST_PLUGIN_DIR_NOOP=\"$(TEST_PLUGIN_DIR_NOOP ) \" \
146
- -DTEST_PLUGIN_ONE=\"$( TEST_PLUGIN_ONE ) \" \
147
- -DTEST_PLUGIN_TWO=\"$( TEST_PLUGIN_TWO ) \" \
148
- -DTEST_PLUGIN_FOUR=\"$( TEST_PLUGIN_FOUR ) \"
43
+ test_plugin_CPPFLAGS = \
44
+ $(AM_CPPFLAGS ) \
45
+ -D_POSIX_C_SOURCE=200809L \
46
+ -DTEST_PLUGIN_DIR_SECURITY =\"$(TEST_PLUGIN_DIR_SECURITY ) \" \
47
+ -DTEST_PLUGIN_DIR_PRIORITY =\"$(TEST_PLUGIN_DIR_PRIORITY ) \" \
48
+ -DTEST_PLUGIN_DIR_NOOP=\"$(TEST_PLUGIN_DIR_NOOP ) \" \
49
+ -DTEST_PLUGIN_ONE=\"@ TEST_PLUGIN_ONE@\" \
50
+ -DTEST_PLUGIN_TWO=\"@ TEST_PLUGIN_TWO@\" \
51
+ -DTEST_PLUGIN_FOUR=\"@ TEST_PLUGIN_FOUR@ \"
149
52
test_plugin_LDADD = \
150
53
$(top_builddir ) /lib/libmptcpd.la \
151
- libmptcpd_test.la \
152
- $(ELL_LIBS )
54
+ $(builddir ) /lib/libmptcpd_test.la \
55
+ $(ELL_LIBS ) \
56
+ $(CODE_COVERAGE_LIBS )
153
57
154
58
test_network_monitor_SOURCES = test-network-monitor.c
155
- test_network_monitor_LDADD = $(top_builddir ) /lib/libmptcpd.la $(ELL_LIBS )
59
+ test_network_monitor_LDADD = \
60
+ $(top_builddir ) /lib/libmptcpd.la \
61
+ $(ELL_LIBS ) \
62
+ $(CODE_COVERAGE_LIBS )
156
63
157
64
test_path_manager_SOURCES = test-path-manager.c
158
65
test_path_manager_CPPFLAGS = \
@@ -161,7 +68,8 @@ test_path_manager_CPPFLAGS = \
161
68
test_path_manager_LDADD = \
162
69
$(top_builddir ) /src/libpath_manager.la \
163
70
$(top_builddir ) /lib/libmptcpd.la \
164
- $(ELL_LIBS )
71
+ $(ELL_LIBS ) \
72
+ $(CODE_COVERAGE_LIBS )
165
73
166
74
test_commands_SOURCES = test-commands.c
167
75
test_commands_CPPFLAGS = \
@@ -170,37 +78,34 @@ test_commands_CPPFLAGS = \
170
78
test_commands_LDADD = \
171
79
$(top_builddir ) /src/libpath_manager.la \
172
80
$(top_builddir ) /lib/libmptcpd.la \
173
- $(ELL_LIBS )
81
+ $(ELL_LIBS ) \
82
+ $(CODE_COVERAGE_LIBS )
174
83
175
84
test_configuration_SOURCES = test-configuration.c
176
85
test_configuration_LDADD = \
177
86
$(top_builddir ) /src/libpath_manager.la \
178
87
$(top_builddir ) /lib/libmptcpd.la \
179
- $(ELL_LIBS )
88
+ $(ELL_LIBS ) \
89
+ $(CODE_COVERAGE_LIBS )
180
90
181
91
if HAVE_CXX
182
92
check_PROGRAMS += test-cxx-build
183
93
test_cxx_build_SOURCES = test-cxx-build.cpp
184
- test_cxx_build_CPPFLAGS = \
185
- $(AM_CPPFLAGS ) \
186
- -DTEST_PLUGIN_DIR=\"$(TEST_PLUGIN_DIR_A ) \" \
187
- -DTEST_PLUGIN_FOUR=\"$( TEST_PLUGIN_FOUR ) \"
188
- test_cxx_build_CXXFLAGS = $(AM_CFLAGS ) -Og
94
+ test_cxx_build_CPPFLAGS = \
95
+ $(AM_CPPFLAGS ) \
96
+ -DTEST_PLUGIN_DIR=\"$(TEST_PLUGIN_DIR_SECURITY ) \" \
97
+ -DTEST_PLUGIN_FOUR=\"@ TEST_PLUGIN_FOUR@ \"
98
+ test_cxx_build_CXXFLAGS = $(AM_CXXFLAGS ) -Og
189
99
test_cxx_build_LDADD = \
190
100
$(top_builddir ) /lib/libmptcpd.la \
191
- libmptcpd_test.la \
192
- $(ELL_LIBS )
101
+ $(builddir ) /lib/libmptcpd_test.la \
102
+ $(ELL_LIBS ) \
103
+ $(CODE_COVERAGE_LIBS )
193
104
endif
194
105
195
- # # "Install" test plugins, as needed, prior to running the tests.
196
- all-local : $(TEST_PLUGIN_DIRS )
197
-
198
- $(TEST_PLUGIN_DIRS ) : $(TEST_PLUGIN_SOURCE_FILES )
199
- $(MAKE ) $(AM_MAKEFLAGS ) install-data
200
-
201
- clean-local :
202
- -rm -rf $(TEST_PLUGIN_DIRS )
203
-
204
106
AM_TESTS_ENVIRONMENT = TEST_PLUGIN_DIR=$(TEST_PLUGIN_DIR_NOOP )
205
107
TESTS = $(check_PROGRAMS ) $(dist_check_SCRIPTS )
206
108
XFAIL_TESTS = $(xfail_test_scripts )
109
+
110
+ # Clean up code coverage related generated files.
111
+ clean-local : code-coverage-clean
0 commit comments