Skip to content

Commit

Permalink
c-list: enable unit tests for third_party/c-list
Browse files Browse the repository at this point in the history
  • Loading branch information
thom311 committed Nov 20, 2024
1 parent d4d1eb7 commit a25f0d7
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -179,6 +180,7 @@ jobs:
libtool \
linux-headers \
make \
meson \
musl-dev \
pkgconfig
Expand Down Expand Up @@ -220,4 +222,5 @@ jobs:
# (odd).
# tests/check-all
# make -j 15 check || (cat ./test-suite.log; false)
make check-local-c-list
done
9 changes: 9 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
26 changes: 26 additions & 0 deletions tools/check-c-list.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit a25f0d7

Please sign in to comment.