test/mem: add external mem autotest to meson
[dpdk.git] / test / test / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017 Intel Corporation
3
4 test_sources = files('commands.c',
5         'packet_burst_generator.c',
6         'test.c',
7         'test_acl.c',
8         'test_alarm.c',
9         'test_atomic.c',
10         'test_barrier.c',
11         'test_bpf.c',
12         'test_byteorder.c',
13         'test_cmdline.c',
14         'test_cmdline_cirbuf.c',
15         'test_cmdline_etheraddr.c',
16         'test_cmdline_ipaddr.c',
17         'test_cmdline_lib.c',
18         'test_cmdline_num.c',
19         'test_cmdline_portlist.c',
20         'test_cmdline_string.c',
21         'test_common.c',
22         'test_cpuflags.c',
23         'test_crc.c',
24         'test_cryptodev.c',
25         'test_cryptodev_asym.c',
26         'test_cryptodev_blockcipher.c',
27         'test_cycles.c',
28         'test_debug.c',
29         'test_distributor.c',
30         'test_distributor_perf.c',
31         'test_eal_flags.c',
32         'test_eal_fs.c',
33         'test_efd.c',
34         'test_efd_perf.c',
35         'test_errno.c',
36         'test_event_crypto_adapter.c',
37         'test_event_eth_rx_adapter.c',
38         'test_event_ring.c',
39         'test_event_eth_tx_adapter.c',
40         'test_event_timer_adapter.c',
41         'test_eventdev.c',
42         'test_external_mem.c',
43         'test_func_reentrancy.c',
44         'test_flow_classify.c',
45         'test_hash.c',
46         'test_hash_functions.c',
47         'test_hash_multiwriter.c',
48         'test_hash_readwrite.c',
49         'test_hash_perf.c',
50         'test_hash_readwrite_lf.c',
51         'test_interrupts.c',
52         'test_kni.c',
53         'test_kvargs.c',
54         'test_link_bonding.c',
55         'test_link_bonding_mode4.c',
56         'test_logs.c',
57         'test_lpm.c',
58         'test_lpm6.c',
59         'test_lpm6_perf.c',
60         'test_lpm_perf.c',
61         'test_malloc.c',
62         'test_mbuf.c',
63         'test_member.c',
64         'test_member_perf.c',
65         'test_memcpy.c',
66         'test_memcpy_perf.c',
67         'test_memory.c',
68         'test_mempool.c',
69         'test_mempool_perf.c',
70         'test_memzone.c',
71         'test_meter.c',
72         'test_metrics.c',
73         'test_mp_secondary.c',
74         'test_per_lcore.c',
75         'test_pmd_perf.c',
76         'test_pmd_ring.c',
77         'test_pmd_ring_perf.c',
78         'test_power.c',
79         'test_power_acpi_cpufreq.c',
80         'test_power_kvm_vm.c',
81         'test_prefetch.c',
82         'test_reciprocal_division.c',
83         'test_reciprocal_division_perf.c',
84         'test_red.c',
85         'test_reorder.c',
86         'test_ring.c',
87         'test_ring_perf.c',
88         'test_rwlock.c',
89         'test_sched.c',
90         'test_service_cores.c',
91         'test_spinlock.c',
92         'test_string_fns.c',
93         'test_table.c',
94         'test_table_acl.c',
95         'test_table_combined.c',
96         'test_table_pipeline.c',
97         'test_table_ports.c',
98         'test_table_tables.c',
99         'test_tailq.c',
100         'test_thash.c',
101         'test_timer.c',
102         'test_timer_perf.c',
103         'test_timer_racecond.c',
104         'test_version.c',
105         'virtual_pmd.c'
106 )
107
108 test_deps = ['acl',
109         'bpf',
110         'cfgfile',
111         'cmdline',
112         'cryptodev',
113         'distributor',
114         'efd',
115         'ethdev',
116         'eventdev',
117         'flow_classify',
118         'hash',
119         'lpm',
120         'member',
121         'metrics',
122         'pipeline',
123         'port',
124         'reorder',
125         'ring',
126         'timer'
127 ]
128
129 test_names = [
130         'acl_autotest',
131         'alarm_autotest',
132         'atomic_autotest',
133         'barrier_autotest',
134         'byteorder_autotest',
135         'cmdline_autotest',
136         'common_autotest',
137         'cpuflags_autotest',
138         'crc_autotest',
139         'cryptodev_qat_autotest',
140         'cryptodev_aesni_mb_autotest',
141         'cryptodev_openssl_autotest',
142         'cryptodev_openssl_asym_autotest',
143         'cryptodev_aesni_gcm_autotest',
144         'cryptodev_null_autotest',
145         'cryptodev_sw_snow3g_autotest',
146         'cryptodev_sw_kasumi_autotest',
147         'cryptodev_sw_zuc_autotest',
148         'cryptodev_sw_armv8_autotest',
149         'cryptodev_sw_mvsam_autotest',
150         'cryptodev_dpaa2_sec_autotest',
151         'cryptodev_dpaa_sec_autotest',
152         'cryptodev_octeontx_autotest',
153         'cycles_autotest',
154         'debug_autotest',
155         'delay_us_sleep_autotest',
156         'devargs_autotest',
157         'distributor_autotest',
158         'distributor_perf_autotest',
159         'eal_flags_autotest',
160         'eal_fs_autotest',
161         'efd_autotest',
162         'efd_perf_autotest',
163         'errno_autotest',
164         'event_crypto_adapter_autotest',
165         'event_eth_rx_adapter_autotest',
166         'event_eth_rx_intr_adapter_autotest',
167         'event_ring_autotest',
168         'event_eth_tx_adapter_autotest',
169         'event_timer_adapter_autotest',
170         'eventdev_common_autotest',
171         'eventdev_octeontx_autotest',
172         'eventdev_sw_autotest',
173         'external_mem_autotest',
174         'func_reentrancy_autotest',
175         'flow_classify_autotest',
176         'hash_autotest',
177         'hash_functions_autotest',
178         'hash_multiwriter_autotest',
179         'hash_perf_autotest',
180         'hash_readwrite_autotest',
181         'hash_readwrite_lf_autotest',
182         'interrupt_autotest',
183         'kni_autotest',
184         'kvargs_autotest',
185         'link_bonding_autotest',
186         'link_bonding_mode4_autotest',
187         'logs_autotest',
188         'lpm6_autotest',
189         'lpm6_perf_autotest',
190         'lpm_autotest',
191         'lpm_perf_autotest',
192         'malloc_autotest',
193         'mbuf_autotest',
194         'member_autotest',
195         'member_perf_autotest',
196         'memcpy_autotest',
197         'memcpy_perf_autotest',
198         'memory_autotest',
199         'mempool_autotest',
200         'mempool_perf_autotest',
201         'memzone_autotest',
202         'meter_autotest',
203         'metrics_autotest',
204         'multiprocess_autotest',
205         'per_lcore_autotest',
206         'pmd_perf_autotest',
207         'power_acpi_cpufreq_autotest',
208         'power_autotest',
209         'power_kvm_vm_autotest',
210         'prefetch_autotest',
211         'reciprocal_division',
212         'reciprocal_division_perf',
213         'red_all',
214         'red_autotest',
215         'red_perf',
216         'reorder_autotest',
217         'ring_autotest',
218         'ring_perf_autotest',
219         'ring_pmd_autotest',
220         'ring_pmd_perf_autotest',
221         'rwlock_autotest',
222         'sched_autotest',
223         'service_autotest',
224         'spinlock_autotest',
225         'string_autotest',
226         'table_autotest',
227         'tailq_autotest',
228         'thash_autotest',
229         'timer_autotest',
230         'timer_perf__autotest',
231         'timer_racecond_autotest',
232         'user_delay_us',
233         'version_autotest',
234 ]
235
236 if dpdk_conf.has('RTE_LIBRTE_PDUMP')
237         test_deps += 'pdump'
238 endif
239 if dpdk_conf.has('RTE_LIBRTE_I40E_PMD')
240         test_deps += 'pmd_i40e'
241 endif
242 if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
243         test_deps += 'pmd_ixgbe'
244 endif
245 if dpdk_conf.has('RTE_LIBRTE_BOND_PMD')
246         test_deps += 'pmd_bond'
247 endif
248 if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
249         test_deps += 'pmd_ring'
250 endif
251 if dpdk_conf.has('RTE_LIBRTE_POWER')
252         test_deps += 'power'
253 endif
254 if dpdk_conf.has('RTE_LIBRTE_KNI')
255         test_deps += 'kni'
256 endif
257
258 cflags = machine_args
259 if cc.has_argument('-Wno-format-truncation')
260     cflags += '-Wno-format-truncation'
261 endif
262
263 # specify -D_GNU_SOURCE unconditionally
264 default_cflags += '-D_GNU_SOURCE'
265
266 test_dep_objs = []
267 compress_test_dep = dependency('zlib', required: false)
268 if compress_test_dep.found()
269         test_dep_objs += compress_test_dep
270         test_sources += 'test_compressdev.c'
271         test_deps += 'compressdev'
272         test_names += 'compressdev_autotest'
273 endif
274
275 foreach d:test_deps
276         def_lib = get_option('default_library')
277         test_dep_objs += get_variable(def_lib + '_rte_' + d)
278 endforeach
279 test_dep_objs += cc.find_library('execinfo', required: false)
280
281 link_libs = []
282 if get_option('default_library') == 'static'
283         link_libs = dpdk_drivers
284 endif
285
286 if get_option('tests')
287         dpdk_test = executable('dpdk-test',
288                 test_sources,
289                 link_whole: link_libs,
290                 dependencies: test_dep_objs,
291                 c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'],
292                 install_rpath: driver_install_path,
293                 install: false)
294
295         # some perf tests (eg: memcpy perf autotest)take very long
296         # to complete, so timeout to 10 minutes
297         timeout_seconds = 600
298
299         foreach t:test_names
300                 test(t, dpdk_test,
301                         env : ['DPDK_TEST='+t],
302                         timeout : timeout_seconds,
303                         is_parallel : false)
304         endforeach
305 endif