test/stack: check stack API
[dpdk.git] / app / 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         'sample_packet_forward.c',
7         'test.c',
8         'test_acl.c',
9         'test_alarm.c',
10         'test_atomic.c',
11         'test_barrier.c',
12         'test_bitratestats.c',
13         'test_bpf.c',
14         'test_byteorder.c',
15         'test_cmdline.c',
16         'test_cmdline_cirbuf.c',
17         'test_cmdline_etheraddr.c',
18         'test_cmdline_ipaddr.c',
19         'test_cmdline_lib.c',
20         'test_cmdline_num.c',
21         'test_cmdline_portlist.c',
22         'test_cmdline_string.c',
23         'test_common.c',
24         'test_cpuflags.c',
25         'test_crc.c',
26         'test_cryptodev.c',
27         'test_cryptodev_asym.c',
28         'test_cryptodev_blockcipher.c',
29         'test_cycles.c',
30         'test_debug.c',
31         'test_distributor.c',
32         'test_distributor_perf.c',
33         'test_eal_flags.c',
34         'test_eal_fs.c',
35         'test_efd.c',
36         'test_efd_perf.c',
37         'test_errno.c',
38         'test_event_crypto_adapter.c',
39         'test_event_eth_rx_adapter.c',
40         'test_event_ring.c',
41         'test_event_eth_tx_adapter.c',
42         'test_event_timer_adapter.c',
43         'test_eventdev.c',
44         'test_external_mem.c',
45         'test_fbarray.c',
46         'test_func_reentrancy.c',
47         'test_flow_classify.c',
48         'test_hash.c',
49         'test_hash_functions.c',
50         'test_hash_multiwriter.c',
51         'test_hash_readwrite.c',
52         'test_hash_perf.c',
53         'test_hash_readwrite_lf.c',
54         'test_interrupts.c',
55         'test_ipsec.c',
56         'test_kni.c',
57         'test_kvargs.c',
58         'test_latencystats.c',
59         'test_link_bonding.c',
60         'test_link_bonding_mode4.c',
61         'test_logs.c',
62         'test_lpm.c',
63         'test_lpm6.c',
64         'test_lpm6_perf.c',
65         'test_lpm_perf.c',
66         'test_malloc.c',
67         'test_mbuf.c',
68         'test_member.c',
69         'test_member_perf.c',
70         'test_memcpy.c',
71         'test_memcpy_perf.c',
72         'test_memory.c',
73         'test_mempool.c',
74         'test_mempool_perf.c',
75         'test_memzone.c',
76         'test_meter.c',
77         'test_metrics.c',
78         'test_mp_secondary.c',
79         'test_pdump.c',
80         'test_per_lcore.c',
81         'test_pmd_perf.c',
82         'test_pmd_ring.c',
83         'test_pmd_ring_perf.c',
84         'test_power.c',
85         'test_power_acpi_cpufreq.c',
86         'test_power_kvm_vm.c',
87         'test_prefetch.c',
88         'test_reciprocal_division.c',
89         'test_reciprocal_division_perf.c',
90         'test_red.c',
91         'test_reorder.c',
92         'test_ring.c',
93         'test_ring_perf.c',
94         'test_rwlock.c',
95         'test_sched.c',
96         'test_service_cores.c',
97         'test_spinlock.c',
98         'test_stack.c',
99         'test_string_fns.c',
100         'test_table.c',
101         'test_table_acl.c',
102         'test_table_combined.c',
103         'test_table_pipeline.c',
104         'test_table_ports.c',
105         'test_table_tables.c',
106         'test_tailq.c',
107         'test_thash.c',
108         'test_timer.c',
109         'test_timer_perf.c',
110         'test_timer_racecond.c',
111         'test_ticketlock.c',
112         'test_version.c',
113         'virtual_pmd.c'
114 )
115
116 test_deps = ['acl',
117         'bitratestats',
118         'bpf',
119         'cfgfile',
120         'cmdline',
121         'cryptodev',
122         'distributor',
123         'efd',
124         'ethdev',
125         'eventdev',
126         'flow_classify',
127         'hash',
128         'ipsec',
129         'latencystats',
130         'lpm',
131         'member',
132         'metrics',
133         'pipeline',
134         'port',
135         'reorder',
136         'ring',
137         'stack',
138         'timer'
139 ]
140
141 # All test cases in fast_parallel_test_names list are parallel
142 fast_parallel_test_names = [
143         'acl_autotest',
144         'alarm_autotest',
145         'atomic_autotest',
146         'byteorder_autotest',
147         'cmdline_autotest',
148         'common_autotest',
149         'cpuflags_autotest',
150         'cycles_autotest',
151         'debug_autotest',
152         'eal_flags_autotest',
153         'eal_fs_autotest',
154         'errno_autotest',
155         'event_ring_autotest',
156         'func_reentrancy_autotest',
157         'flow_classify_autotest',
158         'hash_autotest',
159         'interrupt_autotest',
160         'logs_autotest',
161         'lpm_autotest',
162         'lpm6_autotest',
163         'malloc_autotest',
164         'mbuf_autotest',
165         'memcpy_autotest',
166         'memory_autotest',
167         'mempool_autotest',
168         'memzone_autotest',
169         'meter_autotest',
170         'multiprocess_autotest',
171         'per_lcore_autotest',
172         'prefetch_autotest',
173         'red_autotest',
174         'ring_autotest',
175         'ring_pmd_autotest',
176         'rwlock_autotest',
177         'sched_autotest',
178         'spinlock_autotest',
179         'stack_autotest',
180         'string_autotest',
181         'table_autotest',
182         'tailq_autotest',
183         'timer_autotest',
184         'user_delay_us',
185         'version_autotest',
186 ]
187
188 # All test cases in fast_non_parallel_test_names list are non-parallel
189 fast_non_parallel_test_names = [
190         'bitratestats_autotest',
191         'cryptodev_sw_armv8_autotest',
192         'crc_autotest',
193         'cryptodev_openssl_asym_autotest',
194         'cryptodev_sw_mvsam_autotest',
195         'delay_us_sleep_autotest',
196         'devargs_autotest',
197         'distributor_autotest',
198         'eventdev_common_autotest',
199         'eventdev_octeontx_autotest',
200         'eventdev_sw_autotest',
201         'fbarray_autotest',
202         'hash_readwrite_autotest',
203         'hash_readwrite_lf_autotest',
204         'hash_scaling_autotest',
205         'ipsec_autotest',
206         'kni_autotest',
207         'kvargs_autotest',
208         'latencystats_autotest',
209         'member_autotest',
210         'metrics_autotest',
211         'pdump_autotest',
212         'power_acpi_cpufreq_autotest',
213         'power_autotest',
214         'power_kvm_vm_autotest',
215         'reorder_autotest',
216         'service_autotest',
217         'thash_autotest',
218 ]
219
220 # All test cases in perf_test_names list are non-parallel
221 perf_test_names = [
222         'ring_perf_autotest',
223         'mempool_perf_autotest',
224         'memcpy_perf_autotest',
225         'hash_perf_autotest',
226         'timer_perf_autotest',
227         'reciprocal_division',
228         'reciprocal_division_perf',
229         'lpm_perf_autotest',
230         'red_all',
231         'barrier_autotest',
232         'hash_multiwriter_autotest',
233         'timer_racecond_autotest',
234         'efd_autotest',
235         'hash_functions_autotest',
236         'eventdev_selftest_sw',
237         'member_perf_autotest',
238         'efd_perf_autotest',
239         'lpm6_perf_autotest',
240         'red_perf',
241         'distributor_perf_autotest',
242         'ring_pmd_perf_autotest',
243         'pmd_perf_autotest',
244 ]
245
246 # All test cases in driver_test_names list are non-parallel
247 driver_test_names = [
248         'link_bonding_autotest',
249         'link_bonding_mode4_autotest',
250         'link_bonding_rssconf_autotest',
251         'cryptodev_sw_mrvl_autotest',
252         'cryptodev_dpaa2_sec_autotest',
253         'cryptodev_dpaa_sec_autotest',
254         'cryptodev_qat_autotest',
255         'cryptodev_aesni_mb_autotest',
256         'cryptodev_openssl_autotest',
257         'cryptodev_scheduler_autotest',
258         'cryptodev_aesni_gcm_autotest',
259         'cryptodev_null_autotest',
260         'cryptodev_sw_snow3g_autotest',
261         'cryptodev_sw_kasumi_autotest',
262         'cryptodev_sw_zuc_autotest',
263 ]
264
265 # All test cases in dump_test_names list are non-parallel
266 dump_test_names = [
267         'dump_struct_sizes',
268         'dump_mempool',
269         'dump_malloc_stats',
270         'dump_devargs',
271         'dump_log_types',
272         'dump_ring',
273         'dump_physmem',
274         'dump_memzone',
275 ]
276
277 if dpdk_conf.has('RTE_LIBRTE_PDUMP')
278         test_deps += 'pdump'
279 endif
280 if dpdk_conf.has('RTE_LIBRTE_I40E_PMD')
281         test_deps += 'pmd_i40e'
282 endif
283 if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
284         test_deps += 'pmd_ixgbe'
285 endif
286 if dpdk_conf.has('RTE_LIBRTE_BOND_PMD')
287         test_deps += 'pmd_bond'
288 endif
289 if dpdk_conf.has('RTE_LIBRTE_RING_PMD')
290         test_deps += 'pmd_ring'
291 endif
292 if dpdk_conf.has('RTE_LIBRTE_POWER')
293         test_deps += 'power'
294 endif
295 if dpdk_conf.has('RTE_LIBRTE_KNI')
296         test_deps += 'kni'
297 endif
298
299 cflags = machine_args
300 if cc.has_argument('-Wno-format-truncation')
301     cflags += '-Wno-format-truncation'
302 endif
303
304 # specify -D_GNU_SOURCE unconditionally
305 cflags += '-D_GNU_SOURCE'
306
307 test_dep_objs = []
308 if dpdk_conf.has('RTE_LIBRTE_COMPRESSDEV')
309         compress_test_dep = dependency('zlib', required: false)
310         if compress_test_dep.found()
311                 test_dep_objs += compress_test_dep
312                 test_sources += 'test_compressdev.c'
313                 test_deps += 'compressdev'
314                 fast_non_parallel_test_names += 'compressdev_autotest'
315         endif
316 endif
317
318 foreach d:test_deps
319         def_lib = get_option('default_library')
320         test_dep_objs += get_variable(def_lib + '_rte_' + d)
321 endforeach
322 test_dep_objs += cc.find_library('execinfo', required: false)
323
324 link_libs = []
325 if get_option('default_library') == 'static'
326         link_libs = dpdk_drivers
327 endif
328
329 if get_option('tests')
330         dpdk_test = executable('dpdk-test',
331                 test_sources,
332                 link_whole: link_libs,
333                 dependencies: test_dep_objs,
334                 c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'],
335                 install_rpath: driver_install_path,
336                 install: false)
337
338         # some perf tests (eg: memcpy perf autotest)take very long
339         # to complete, so timeout to 10 minutes
340         timeout_seconds = 600
341         timeout_seconds_fast = 10
342
343         foreach arg : fast_parallel_test_names
344                 test(arg, dpdk_test,
345                         env : ['DPDK_TEST=' + arg],
346                         args : ['-c f','-n 4', '--file-prefix=@0@'.format(arg)],
347                         timeout : timeout_seconds_fast,
348                         suite : 'fast-tests')
349         endforeach
350
351         foreach arg : fast_non_parallel_test_names
352                 test(arg, dpdk_test,
353                         env : ['DPDK_TEST=' + arg],
354                         timeout : timeout_seconds_fast,
355                         is_parallel : false,
356                         suite : 'fast-tests')
357         endforeach
358
359         foreach arg : perf_test_names
360                 test(arg, dpdk_test,
361                 env : ['DPDK_TEST=' + arg],
362                 timeout : timeout_seconds,
363                 is_parallel : false,
364                 suite : 'perf-tests')
365         endforeach
366
367         foreach arg : driver_test_names
368                 test(arg, dpdk_test,
369                         env : ['DPDK_TEST=' + arg],
370                         timeout : timeout_seconds,
371                         is_parallel : false,
372                         suite : 'driver-tests')
373         endforeach
374
375         foreach arg : dump_test_names
376                 test(arg, dpdk_test,
377                         env : ['DPDK_TEST=' + arg],
378                         timeout : timeout_seconds,
379                         is_parallel : false,
380                         suite : 'debug-tests')
381         endforeach
382 endif