From a20936f17a9aa291e47c2b4ee793f99d1f2242b9 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 20 Nov 2024 08:37:02 +0100 Subject: [PATCH] c-list: enable unit tests for third_party/c-list --- .github/workflows/ci.yml | 8 +++++--- Makefile.am | 9 +++++++++ tools/check-c-list.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-) create mode 100755 tools/check-c-list.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f34d900c..4962ae13 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,8 +45,9 @@ jobs: sudo apt-get update sudo apt-get -y --no-install-recommends install \ check \ - valgrind \ - libtool-bin + libtool-bin \ + meson \ + valgrind - name: Check out repository code uses: actions/checkout@v3 @@ -179,6 +180,7 @@ jobs: libtool \ linux-headers \ make \ + meson \ musl-dev \ pkgconfig @@ -193,7 +195,6 @@ jobs: run: | set -x - export CC="${{ matrix.cc }}" export CFLAGS="-DNL_MORE_ASSERTS=1000 -O2 -Werror -std=gnu11 -fexceptions" if [ "$CC" = "clang" ]; then CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument -Wno-error=unused-function" @@ -220,4 +221,5 @@ jobs: # (odd). # tests/check-all # make -j 15 check || (cat ./test-suite.log; false) + make check-local-c-list done diff --git a/Makefile.am b/Makefile.am index 8411d644..1b903981 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1184,6 +1184,15 @@ endif ############################################################################### +check-local-c-list: + $(srcdir)/tools/check-c-list.sh + +check_local += check-local-c-list + +EXTRA_DIST += tools/check-c-list.sh + +############################################################################### + check-local: $(check_build) $(check_local) .PHONY: $(check_local) diff --git a/tools/check-c-list.sh b/tools/check-c-list.sh new file mode 100755 index 00000000..6232b11e --- /dev/null +++ b/tools/check-c-list.sh @@ -0,0 +1,26 @@ +#!/usr/bin/bash + +set -e + +print_and_exit() { + local err="$1" + shift + printf '%s\n' "$*" + exit "$err" +} + +die() { + print_and_exit 1 "$@" +} + +command -v meson &>/dev/null || print_and_exit 0 "skip: meson not available" +command -v ninja &>/dev/null || print_and_exit 0 "skip: ninja not available" + +cd ./third_party/c-list/ + +if [ ! -d "./build/" ] ; then + meson ./build/ || die "meson failed" + ninja -C ./build/ || die "failed build" +fi + +ninja -C ./build/ test || die "c-list tests failed"