From e1182762965da40e8a6f84276167aa1d254a5fda Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 19 Jul 2022 09:06:00 +0200 Subject: [PATCH] gitlab-ci: run unit tests for git subtree subprojects --- .gitlab-ci/run-test.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.gitlab-ci/run-test.sh b/.gitlab-ci/run-test.sh index 0e2f3f52ef..8ae519596c 100755 --- a/.gitlab-ci/run-test.sh +++ b/.gitlab-ci/run-test.sh @@ -61,4 +61,37 @@ if [ "$NM_BUILD_TARBALL" = 1 ]; then mv /tmp/NetworkManager-1*.tar.xz /tmp/NetworkManager-1*.src.rpm ./ fi +############################################################################### + +test_subtree() { + local d="$1" + local cc="$2" + + if meson --version | grep -q '^0\.[0-5][0-9]\.' ; then + # These subprojects require a newer meson than NetworkManager. Skip the test. + return 0 + fi + + do_clean + pushd ./src/$d + + ARGS=() + if [ "$d" = n-acd ]; then + ARGS+=('-Debpf=false') + fi + + CC="$cc" CFLAGS="-Werror -Wall" meson build "${ARGS[@]}" + ninja -v -C build test + + popd +} + +for d in c-list c-rbtree c-siphash c-stdaux n-acd n-dhcp4 ; do + for cc in gcc clang; do + test_subtree "$d" "$cc" + done +done + +############################################################################### + echo "BUILD SUCCESSFUL!!"