test: build app with meson as dpdk-test
[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_byteorder.c',
11         'test_cmdline.c',
12         'test_cmdline_cirbuf.c',
13         'test_cmdline_etheraddr.c',
14         'test_cmdline_ipaddr.c',
15         'test_cmdline_lib.c',
16         'test_cmdline_num.c',
17         'test_cmdline_portlist.c',
18         'test_cmdline_string.c',
19         'test_common.c',
20         'test_cpuflags.c',
21         'test_crc.c',
22         'test_cycles.c',
23         'test_debug.c',
24         'test_devargs.c',
25         'test_distributor.c',
26         'test_distributor_perf.c',
27         'test_eal_flags.c',
28         'test_eal_fs.c',
29         'test_efd.c',
30         'test_efd_perf.c',
31         'test_errno.c',
32         'test_event_ring.c',
33         'test_eventdev.c',
34         'test_func_reentrancy.c',
35         'test_hash.c',
36         'test_hash_functions.c',
37         'test_hash_multiwriter.c',
38         'test_hash_perf.c',
39         'test_hash_scaling.c',
40         'test_interrupts.c',
41         'test_kni.c',
42         'test_kvargs.c',
43         'test_logs.c',
44         'test_lpm.c',
45         'test_lpm6.c',
46         'test_lpm6_perf.c',
47         'test_lpm_perf.c',
48         'test_malloc.c',
49         'test_mbuf.c',
50         'test_memcpy.c',
51         'test_memcpy_perf.c',
52         'test_memory.c',
53         'test_mempool.c',
54         'test_mempool_perf.c',
55         'test_memzone.c',
56         'test_meter.c',
57         'test_mp_secondary.c',
58         'test_per_lcore.c',
59         'test_pmd_perf.c',
60         'test_power.c',
61         'test_power_acpi_cpufreq.c',
62         'test_power_kvm_vm.c',
63         'test_prefetch.c',
64         'test_red.c',
65         'test_reorder.c',
66         'test_ring.c',
67         'test_ring_perf.c',
68         'test_rwlock.c',
69         'test_sched.c',
70         'test_service_cores.c',
71         'test_spinlock.c',
72         'test_string_fns.c',
73         'test_table.c',
74         'test_table_acl.c',
75         'test_table_combined.c',
76         'test_table_pipeline.c',
77         'test_table_ports.c',
78         'test_table_tables.c',
79         'test_tailq.c',
80         'test_thash.c',
81         'test_timer.c',
82         'test_timer_perf.c',
83         'test_timer_racecond.c',
84         'test_version.c',
85         'virtual_pmd.c'
86 )
87
88 test_deps = ['acl',
89         'cfgfile',
90         'cmdline',
91         'cryptodev',
92         'distributor',
93         'efd',
94         'ethdev',
95         'eventdev',
96         'hash',
97         'lpm',
98         'pipeline',
99         'port',
100         'power',
101         'reorder',
102         'ring',
103         'timer'
104 ]
105
106 test_names = [
107         'acl_autotest',
108         'alarm_autotest',
109         'atomic_autotest',
110         'byteorder_autotest',
111         'cmdline_autotest',
112         'common_autotest',
113         'cpuflags_autotest',
114         'crc_autotest',
115         'cycles_autotest',
116         'debug_autotest',
117         'devargs_autotest',
118         'distributor_autotest',
119         'distributor_perf_autotest',
120         'eal_flags_autotest',
121         'eal_fs_autotest',
122         'efd_autotest',
123         'efd_perf_autotest',
124         'errno_autotest',
125         'event_ring_autotest',
126         'eventdev_common_autotest',
127         'eventdev_octeontx_autotest',
128         'eventdev_sw_autotest',
129         'func_reentrancy_autotest',
130         'hash_scaling_autotest',
131         'hash_autotest',
132         'hash_functions_autotest',
133         'hash_multiwriter_autotest',
134         'hash_perf_autotest',
135         'interrupt_autotest',
136         'kni_autotest',
137         'kvargs_autotest',
138         'logs_autotest',
139         'lpm6_autotest',
140         'lpm6_perf_autotest',
141         'lpm_autotest',
142         'lpm_perf_autotest',
143         'malloc_autotest',
144         'mbuf_autotest',
145         'memcpy_autotest',
146         'memcpy_perf_autotest',
147         'memory_autotest',
148         'mempool_autotest',
149         'mempool_perf_autotest',
150         'memzone_autotest',
151         'meter_autotest',
152         'multiprocess_autotest',
153         'per_lcore_autotest',
154         'pmd_perf_autotest',
155         'power_acpi_cpufreq_autotest',
156         'power_autotest',
157         'power_kvm_vm_autotest',
158         'prefetch_autotest',
159         'red_all',
160         'red_autotest',
161         'red_perf',
162         'reorder_autotest',
163         'ring_autotest',
164         'ring_perf_autotest',
165         'rwlock_autotest',
166         'sched_autotest',
167         'service_autotest',
168         'spinlock_autotest',
169         'table_autotest',
170         'tailq_autotest',
171         'thash_autotest',
172         'timer_autotest',
173         'timer_perf__autotest',
174         'timer_racecond_autotest',
175         'user_delay_us',
176         'version_autotest',
177 ]
178
179 if dpdk_conf.has('RTE_LIBRTE_PDUMP')
180         test_deps += 'pdump'
181 endif
182 if dpdk_conf.has('RTE_LIBRTE_I40E_PMD')
183         test_deps += 'pmd_i40e'
184 endif
185 if dpdk_conf.has('RTE_LIBRTE_IXGBE_PMD')
186         test_deps += 'pmd_ixgbe'
187 endif
188
189 test_dep_objs = []
190 foreach d:test_deps
191         def_lib = get_option('default_library')
192         test_dep_objs += get_variable(def_lib + '_rte_' + d)
193 endforeach
194
195 link_libs = []
196 if get_option('default_library') == 'static'
197         link_libs = dpdk_drivers
198 endif
199
200 if get_option('tests')
201         dpdk_test = executable('dpdk-test',
202                 test_sources,
203                 link_whole: link_libs,
204                 dependencies: test_dep_objs,
205                 c_args: [machine_arg, '-DALLOW_EXPERIMENTAL_API'],
206                 install_rpath: driver_install_path,
207                 install: false)
208
209         # some perf tests (eg: memcpy perf autotest)take very long
210         # to complete, so timeout to 10 minutes
211         timeout_seconds = 600
212
213         foreach t:test_names
214                 test(t, dpdk_test,
215                         env : ['DPDK_TEST='+t],
216                         timeout : timeout_seconds,
217                         is_parallel : false)
218         endforeach
219 endif