test: fix autotest list
[dpdk.git] / test / test / Makefile
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2017 Intel Corporation
3
4 include $(RTE_SDK)/mk/rte.vars.mk
5
6 ifeq ($(CONFIG_RTE_APP_TEST),y)
7
8 # default rule
9 all:
10
11 # Define an externally linked resource. A linked resource is an arbitrary
12 # file that is linked into the test binary. The application refers to this
13 # resource by name. The linked generates identifiers beg_<name> and end_<name>
14 # for referencing by the C code.
15 #
16 # Parameters: <unique name>, <file to be linked>
17 define linked_resource
18 SRCS-y += $(1).res.o
19 $(1).res.o: $(2)
20         @  echo '  MKRES $$@'
21         $Q [ "$$(<D)" = . ] || ln -fs $$<
22         $Q $(OBJCOPY) -I binary -B $(RTE_OBJCOPY_ARCH) -O $(RTE_OBJCOPY_TARGET) \
23                 --rename-section                                         \
24                         .data=.rodata,alloc,load,data,contents,readonly  \
25                 --redefine-sym _binary_$$(subst .,_,$$(<F))_start=beg_$(1) \
26                 --redefine-sym _binary_$$(subst .,_,$$(<F))_end=end_$(1)   \
27                 --redefine-sym _binary_$$(subst .,_,$$(<F))_size=siz_$(1)  \
28                 $$(<F) $$@
29 endef
30
31 ifeq ($(CONFIG_RTE_APP_TEST_RESOURCE_TAR),y)
32 define linked_tar_resource
33 $(1).tar: $(2)
34         @  echo '  TAR $$@'
35         $Q tar -C $$(dir $$<) -cf $$@ $$(notdir $$<)
36 $(call linked_resource,$(1),$(1).tar)
37 endef
38 else # ! CONFIG_RTE_APP_TEST_RESOURCE_TAR
39 linked_tar_resource =
40 endif # CONFIG_RTE_APP_TEST_RESOURCE_TAR
41
42 #
43 # library name
44 #
45 APP = test
46
47 #
48 # all sources are stored in SRCS-y
49 #
50 SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := commands.c
51 SRCS-y += test.c
52 SRCS-y += resource.c
53 SRCS-y += test_resource.c
54 test_resource.res: test_resource.c
55         @ cp $< $@
56 $(eval $(call linked_resource,test_resource_c,test_resource.res))
57 $(eval $(call linked_tar_resource,test_resource_tar,test_resource.c))
58 SRCS-$(CONFIG_RTE_APP_TEST_RESOURCE_TAR) += test_cfgfile.c
59 $(eval $(call linked_tar_resource,test_cfgfiles,test_cfgfiles))
60 SRCS-y += test_prefetch.c
61 SRCS-y += test_byteorder.c
62 SRCS-y += test_per_lcore.c
63 SRCS-y += test_atomic.c
64 SRCS-y += test_barrier.c
65 SRCS-y += test_malloc.c
66 SRCS-y += test_cycles.c
67 SRCS-y += test_spinlock.c
68 SRCS-y += test_memory.c
69 SRCS-y += test_memzone.c
70 SRCS-y += test_bitmap.c
71 SRCS-y += test_reciprocal_division.c
72 SRCS-y += test_reciprocal_division_perf.c
73 SRCS-y += test_fbarray.c
74 SRCS-y += test_external_mem.c
75
76 SRCS-y += test_ring.c
77 SRCS-y += test_ring_perf.c
78 SRCS-y += test_pmd_perf.c
79
80 ifeq ($(CONFIG_RTE_LIBRTE_TABLE),y)
81 SRCS-y += test_table.c
82 SRCS-$(CONFIG_RTE_LIBRTE_PIPELINE) += test_table_pipeline.c
83 SRCS-y += test_table_tables.c
84 SRCS-y += test_table_ports.c
85 SRCS-y += test_table_combined.c
86 SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_table_acl.c
87 SRCS-$(CONFIG_RTE_LIBRTE_FLOW_CLASSIFY) += test_flow_classify.c
88 endif
89
90 SRCS-y += test_rwlock.c
91
92 SRCS-$(CONFIG_RTE_LIBRTE_TIMER) += test_timer.c
93 SRCS-$(CONFIG_RTE_LIBRTE_TIMER) += test_timer_perf.c
94 SRCS-$(CONFIG_RTE_LIBRTE_TIMER) += test_timer_racecond.c
95
96 SRCS-y += test_mempool.c
97 SRCS-y += test_mempool_perf.c
98
99 SRCS-y += test_mbuf.c
100 SRCS-y += test_logs.c
101
102 SRCS-y += test_memcpy.c
103 SRCS-y += test_memcpy_perf.c
104
105
106 SRCS-$(CONFIG_RTE_LIBRTE_MEMBER) += test_member.c
107 SRCS-$(CONFIG_RTE_LIBRTE_MEMBER) += test_member_perf.c
108
109 SRCS-$(CONFIG_RTE_LIBRTE_EFD) += test_efd.c
110 SRCS-$(CONFIG_RTE_LIBRTE_EFD) += test_efd_perf.c
111
112 SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash.c
113 SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_thash.c
114 SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_perf.c
115 SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_functions.c
116 SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_multiwriter.c
117 SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_readwrite.c
118 SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_readwrite_lf.c
119
120 SRCS-$(CONFIG_RTE_LIBRTE_LPM) += test_lpm.c
121 SRCS-$(CONFIG_RTE_LIBRTE_LPM) += test_lpm_perf.c
122 SRCS-$(CONFIG_RTE_LIBRTE_LPM) += test_lpm6.c
123 SRCS-$(CONFIG_RTE_LIBRTE_LPM) += test_lpm6_perf.c
124
125 SRCS-y += test_debug.c
126 SRCS-y += test_errno.c
127 SRCS-y += test_tailq.c
128 SRCS-y += test_string_fns.c
129 SRCS-y += test_cpuflags.c
130 SRCS-y += test_mp_secondary.c
131 SRCS-y += test_eal_flags.c
132 SRCS-y += test_eal_fs.c
133 SRCS-y += test_alarm.c
134 SRCS-y += test_interrupts.c
135 SRCS-y += test_version.c
136 SRCS-y += test_func_reentrancy.c
137
138 SRCS-y += test_service_cores.c
139
140 SRCS-$(CONFIG_RTE_LIBRTE_BITRATE) += test_bitratestats.c
141 SRCS-$(CONFIG_RTE_LIBRTE_LATENCY_STATS) += test_latencystats.c
142
143 SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline.c
144 SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_num.c
145 SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_etheraddr.c
146 SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_portlist.c
147 SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_ipaddr.c
148 SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_cirbuf.c
149 SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_string.c
150 SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_lib.c
151
152 SRCS-$(CONFIG_RTE_LIBRTE_NET) += test_crc.c
153
154 ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y)
155 SRCS-y += test_red.c
156 SRCS-y += test_sched.c
157 endif
158
159 SRCS-$(CONFIG_RTE_LIBRTE_METER) += test_meter.c
160 SRCS-$(CONFIG_RTE_LIBRTE_KNI) += test_kni.c
161 SRCS-$(CONFIG_RTE_LIBRTE_POWER) += test_power.c test_power_acpi_cpufreq.c
162 SRCS-$(CONFIG_RTE_LIBRTE_POWER) += test_power_kvm_vm.c
163 SRCS-y += test_common.c
164
165 SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += test_distributor.c
166 SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += test_distributor_perf.c
167
168 SRCS-$(CONFIG_RTE_LIBRTE_REORDER) += test_reorder.c
169
170 SRCS-$(CONFIG_RTE_LIBRTE_PDUMP) += test_pdump.c
171
172 SRCS-y += virtual_pmd.c
173 SRCS-y += packet_burst_generator.c
174 SRCS-y += sample_packet_forward.c
175 SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_acl.c
176
177 ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y)
178 SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding.c
179 SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_mode4.c
180 endif
181
182 ifeq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y)
183 SRCS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += test_link_bonding_rssconf.c
184 endif
185
186 SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring.c
187 SRCS-$(CONFIG_RTE_LIBRTE_PMD_RING) += test_pmd_ring_perf.c
188
189 SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_blockcipher.c
190 SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev.c
191 SRCS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += test_cryptodev_asym.c
192
193 SRCS-$(CONFIG_RTE_LIBRTE_METRICS) += test_metrics.c
194
195 ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y)
196 SRCS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += test_compressdev.c
197 endif
198
199 ifeq ($(CONFIG_RTE_LIBRTE_EVENTDEV),y)
200 SRCS-y += test_eventdev.c
201 SRCS-y += test_event_ring.c
202 SRCS-y += test_event_eth_rx_adapter.c
203 SRCS-y += test_event_eth_tx_adapter.c
204 SRCS-y += test_event_timer_adapter.c
205 SRCS-y += test_event_crypto_adapter.c
206 endif
207
208 ifeq ($(CONFIG_RTE_LIBRTE_RAWDEV),y)
209 SRCS-y += test_rawdev.c
210 endif
211
212 SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) += test_kvargs.c
213
214 SRCS-$(CONFIG_RTE_LIBRTE_BPF) += test_bpf.c
215
216 SRCS-$(CONFIG_RTE_LIBRTE_IPSEC) += test_ipsec.c
217 ifeq ($(CONFIG_RTE_LIBRTE_IPSEC),y)
218 LDLIBS += -lrte_ipsec
219 endif
220
221 CFLAGS += -DALLOW_EXPERIMENTAL_API
222
223 CFLAGS += -O3
224 CFLAGS += $(WERROR_FLAGS)
225
226 LDLIBS += -lm
227
228 ifeq ($(CONFIG_RTE_LIBRTE_PDUMP),y)
229 LDLIBS += -lpthread
230 endif
231
232 ifeq ($(CONFIG_RTE_COMPRESSDEV_TEST),y)
233 ifeq ($(CONFIG_RTE_LIBRTE_COMPRESSDEV),y)
234 LDLIBS += -lz
235 endif
236 endif
237
238 # Disable VTA for memcpy test
239 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
240 ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1)
241 CFLAGS_test_memcpy.o += -fno-var-tracking-assignments
242 CFLAGS_test_memcpy_perf.o += -fno-var-tracking-assignments
243 # for older GCC versions, allow us to initialize an event using
244 # designated initializers.
245 ifeq ($(shell test $(GCC_VERSION) -le 50 && echo 1), 1)
246 CFLAGS_test_eventdev_sw.o += -Wno-missing-field-initializers
247 CFLAGS_test_event_timer_adapter.o += -Wno-missing-field-initializers
248 CFLAGS_test_event_crypto_adapter.o += -Wno-missing-field-initializers
249 endif
250 endif
251 endif
252
253 # Link against shared libraries when needed
254 ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y)
255 ifneq ($(CONFIG_RTE_LIBRTE_PMD_RING),y)
256 $(error Link bonding tests require CONFIG_RTE_LIBRTE_PMD_RING=y)
257 endif
258 endif
259
260 ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
261
262 ifeq ($(CONFIG_RTE_LIBRTE_PMD_BOND),y)
263 LDLIBS += -lrte_pmd_bond
264 endif
265
266 ifeq ($(CONFIG_RTE_LIBRTE_PMD_NULL),y)
267 LDLIBS += -lrte_pmd_null
268 endif
269
270 ifeq ($(CONFIG_RTE_LIBRTE_PMD_RING),y)
271 LDLIBS += -lrte_pmd_ring
272 endif
273
274 ifeq ($(CONFIG_RTE_LIBRTE_PMD_CRYPTO_SCHEDULER),y)
275 LDLIBS += -lrte_pmd_crypto_scheduler
276 endif
277
278 endif
279
280 ifeq ($(CONFIG_RTE_APP_TEST_RESOURCE_TAR),y)
281 LDLIBS += -larchive
282 endif
283
284 include $(RTE_SDK)/mk/rte.app.mk
285
286 endif