So far, users of test-meson-builds.sh had to define their own set of examples to build externally. This is not that great because users need to maintain this list when examples are removed/added.
Rework the script so that the 'all' value triggers an automatic discovery based on what was configured/compiled with meson/ninja. Signed-off-by: David Marchand <david.march...@redhat.com> Acked-by: Bruce Richardson <bruce.richard...@intel.com> --- Changes since v1: - reworked built examples discovery, - added comment for people who are not sed fluent, --- devtools/test-meson-builds.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index 9131088c9d..05bc15e280 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -299,6 +299,22 @@ export PKG_CONFIG_PATH=$(dirname $pc_file):$PKG_CONFIG_PATH libdir=$(dirname $(find $DESTDIR -name librte_eal.so)) export LD_LIBRARY_PATH=$libdir:$LD_LIBRARY_PATH examples=${DPDK_BUILD_TEST_EXAMPLES:-"cmdline helloworld l2fwd l3fwd skeleton timer"} +if [ "$examples" = 'all' ]; then + examples=$(find $build_path/examples -maxdepth 1 -type f -name "dpdk-*" | + while read target; do + target=${target%%:*} + target=${target#$build_path/examples/dpdk-} + if [ -e $srcdir/examples/$target/Makefile ]; then + echo $target + continue + fi + # Some examples binaries are built from an example sub + # directory, discover the "top level" example name. + find $srcdir/examples -name Makefile | + sed -ne "s,$srcdir/examples/\([^/]*\)\(/.*\|\)/$target/Makefile,\1,p" + done | sort -u | + tr '\n' ' ') +fi # if pkg-config defines the necessary flags, test building some examples if pkg-config --define-prefix libdpdk >/dev/null 2>&1; then export PKGCONF="pkg-config --define-prefix" -- 2.40.1