F: app/test/Makefile
F: app/test/autotest*
F: app/test/commands.c
+F: app/test/get-coremask.sh
F: app/test/packet_burst_generator.c
F: app/test/packet_burst_generator.h
F: app/test/process.h
--- /dev/null
+#! /bin/sh -e
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2019 Intel Corporation
+
+if [ "$(uname)" = "Linux" ] ; then
+ cat /sys/devices/system/cpu/present
+elif [ "$(uname)" = "FreeBSD" ] ; then
+ ncpus=$(/sbin/sysctl -n hw.ncpu)
+ echo 0-$(expr $ncpus - 1)
+else
+# fallback
+ echo 0-3
+fi
timeout_seconds = 600
timeout_seconds_fast = 10
-# Retrieve the number of CPU cores, defaulting to 4.
-num_cores = '0-3'
-if host_machine.system() == 'linux'
- num_cores = run_command('cat',
- '/sys/devices/system/cpu/present'
- ).stdout().strip()
-elif host_machine.system() == 'freebsd'
- snum_cores = run_command('/sbin/sysctl', '-n',
- 'hw.ncpu').stdout().strip()
- inum_cores = snum_cores.to_int() - 1
- num_cores = '0-@0@'.format(inum_cores)
-endif
-
-num_cores_arg = '-l ' + num_cores
+get_coremask = find_program('get-coremask.sh')
+num_cores_arg = '-l ' + run_command(get_coremask).stdout().strip()
test_args = [num_cores_arg]
foreach arg : fast_test_names