Skip to content

Commit 8cb511b

Browse files
igsilyatmonjalo
authored andcommitted
test: skip meson dependency checks if not required
Don't need to check dependencies if test apps will not be built anyway. Signed-off-by: Ilya Maximets <[email protected]> Acked-by: Bruce Richardson <[email protected]> Acked-by: Aaron Conole <[email protected]> Acked-by: Luca Boccassi <[email protected]>
1 parent 16c4ea4 commit 8cb511b

File tree

1 file changed

+72
-69
lines changed

1 file changed

+72
-69
lines changed

app/test/meson.build

+72-69
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# SPDX-License-Identifier: BSD-3-Clause
22
# Copyright(c) 2017 Intel Corporation
33

4+
if not get_option('tests')
5+
subdir_done()
6+
endif
7+
48
test_sources = files('commands.c',
59
'packet_burst_generator.c',
610
'sample_packet_forward.c',
@@ -335,86 +339,85 @@ if get_option('default_library') == 'static'
335339
link_libs = dpdk_drivers
336340
endif
337341

338-
if get_option('tests')
339-
dpdk_test = executable('dpdk-test',
340-
test_sources,
341-
link_whole: link_libs,
342-
dependencies: test_dep_objs,
343-
c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'],
344-
install_rpath: driver_install_path,
345-
install: false)
342+
dpdk_test = executable('dpdk-test',
343+
test_sources,
344+
link_whole: link_libs,
345+
dependencies: test_dep_objs,
346+
c_args: [cflags, '-DALLOW_EXPERIMENTAL_API'],
347+
install_rpath: driver_install_path,
348+
install: false)
346349

347-
# some perf tests (eg: memcpy perf autotest)take very long
348-
# to complete, so timeout to 10 minutes
349-
timeout_seconds = 600
350-
timeout_seconds_fast = 10
351-
352-
# Retrieve the number of CPU cores, defaulting to 4.
353-
num_cores = '0-3'
354-
if host_machine.system() == 'linux'
355-
num_cores = run_command('cat',
356-
'/sys/devices/system/cpu/present'
357-
).stdout().strip()
358-
elif host_machine.system() == 'freebsd'
359-
snum_cores = run_command('/sbin/sysctl', '-n',
360-
'hw.ncpu').stdout().strip()
361-
inum_cores = snum_cores.to_int() - 1
362-
num_cores = '0-@0@'.format(inum_cores)
363-
endif
350+
# some perf tests (eg: memcpy perf autotest)take very long
351+
# to complete, so timeout to 10 minutes
352+
timeout_seconds = 600
353+
timeout_seconds_fast = 10
364354

365-
num_cores_arg = '-l ' + num_cores
355+
# Retrieve the number of CPU cores, defaulting to 4.
356+
num_cores = '0-3'
357+
if host_machine.system() == 'linux'
358+
num_cores = run_command('cat',
359+
'/sys/devices/system/cpu/present'
360+
).stdout().strip()
361+
elif host_machine.system() == 'freebsd'
362+
snum_cores = run_command('/sbin/sysctl', '-n',
363+
'hw.ncpu').stdout().strip()
364+
inum_cores = snum_cores.to_int() - 1
365+
num_cores = '0-@0@'.format(inum_cores)
366+
endif
366367

367-
test_args = [num_cores_arg, '-n 4']
368-
foreach arg : fast_parallel_test_names
369-
if host_machine.system() == 'linux'
370-
test(arg, dpdk_test,
371-
env : ['DPDK_TEST=' + arg],
372-
args : test_args +
373-
['--file-prefix=@0@'.format(arg)],
374-
timeout : timeout_seconds_fast,
375-
suite : 'fast-tests')
376-
else
377-
test(arg, dpdk_test,
378-
env : ['DPDK_TEST=' + arg],
379-
args : test_args,
380-
timeout : timeout_seconds_fast,
381-
suite : 'fast-tests')
382-
endif
383-
endforeach
368+
num_cores_arg = '-l ' + num_cores
384369

385-
foreach arg : fast_non_parallel_test_names
370+
test_args = [num_cores_arg, '-n 4']
371+
foreach arg : fast_parallel_test_names
372+
if host_machine.system() == 'linux'
373+
test(arg, dpdk_test,
374+
env : ['DPDK_TEST=' + arg],
375+
args : test_args +
376+
['--file-prefix=@0@'.format(arg)],
377+
timeout : timeout_seconds_fast,
378+
suite : 'fast-tests')
379+
else
386380
test(arg, dpdk_test,
387381
env : ['DPDK_TEST=' + arg],
388382
args : test_args,
389-
timeout : timeout_seconds_fast,
390-
is_parallel : false,
391-
suite : 'fast-tests')
392-
endforeach
383+
timeout : timeout_seconds_fast,
384+
suite : 'fast-tests')
385+
endif
386+
endforeach
393387

394-
foreach arg : perf_test_names
395-
test(arg, dpdk_test,
388+
foreach arg : fast_non_parallel_test_names
389+
test(arg, dpdk_test,
390+
env : ['DPDK_TEST=' + arg],
391+
args : test_args,
392+
timeout : timeout_seconds_fast,
393+
is_parallel : false,
394+
suite : 'fast-tests')
395+
endforeach
396+
397+
foreach arg : perf_test_names
398+
test(arg, dpdk_test,
399+
env : ['DPDK_TEST=' + arg],
400+
args : test_args,
401+
timeout : timeout_seconds,
402+
is_parallel : false,
403+
suite : 'perf-tests')
404+
endforeach
405+
406+
foreach arg : driver_test_names
407+
test(arg, dpdk_test,
396408
env : ['DPDK_TEST=' + arg],
397409
args : test_args,
398410
timeout : timeout_seconds,
399411
is_parallel : false,
400-
suite : 'perf-tests')
401-
endforeach
412+
suite : 'driver-tests')
413+
endforeach
402414

403-
foreach arg : driver_test_names
404-
test(arg, dpdk_test,
405-
env : ['DPDK_TEST=' + arg],
406-
args : test_args,
407-
timeout : timeout_seconds,
408-
is_parallel : false,
409-
suite : 'driver-tests')
410-
endforeach
415+
foreach arg : dump_test_names
416+
test(arg, dpdk_test,
417+
env : ['DPDK_TEST=' + arg],
418+
args : test_args,
419+
timeout : timeout_seconds,
420+
is_parallel : false,
421+
suite : 'debug-tests')
422+
endforeach
411423

412-
foreach arg : dump_test_names
413-
test(arg, dpdk_test,
414-
env : ['DPDK_TEST=' + arg],
415-
args : test_args,
416-
timeout : timeout_seconds,
417-
is_parallel : false,
418-
suite : 'debug-tests')
419-
endforeach
420-
endif

0 commit comments

Comments
 (0)