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