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..49774d13 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1184,6 +1184,31 @@ endif ############################################################################### +check-local-c-list: + "$(srcdir)/tools/check-c-list.sh" + +check_local += check-local-c-list + +CLEANFILES += ./c-list-build/ + +EXTRA_DIST += tools/check-c-list.sh + +EXTRA_DIST += \ + third_party/c-list/AUTHORS \ + third_party/c-list/.editorconfig \ + third_party/c-list/.github/workflows/ci.yml \ + third_party/c-list/meson.build \ + third_party/c-list/NEWS.md \ + third_party/c-list/README.md \ + third_party/c-list/src/c-list.h \ + third_party/c-list/src/meson.build \ + third_party/c-list/src/test-api.c \ + third_party/c-list/src/test-basic.c \ + third_party/c-list/src/test-embed.c \ + $(NULL) + +############################################################################### + 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..74b13ab0 --- /dev/null +++ b/tools/check-c-list.sh @@ -0,0 +1,30 @@ +#!/usr/bin/bash + +set -ex + +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" + +BUILDDIR="$PWD" +SRCDIR="$(dirname "$0")/.." + +_BUILDDIR="$BUILDDIR/build-c-list" +_SRCDIR="$SRCDIR/third_party/c-list" + +if [ ! -d "$_BUILDDIR" ] ; then + meson setup "$_BUILDDIR" "$_SRCDIR" || die "meson failed" + ninja -C "$_BUILDDIR" || die "failed build" +fi + +ninja -C "$_BUILDDIR" test || die "c-list tests failed"