Skip to content

Commit 6ba3f5f

Browse files
committed
c-list: enable unit tests for third_party/c-list
1 parent d4d1eb7 commit 6ba3f5f

File tree

3 files changed

+66
-3
lines changed

3 files changed

+66
-3
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ jobs:
4545
sudo apt-get update
4646
sudo apt-get -y --no-install-recommends install \
4747
check \
48-
valgrind \
49-
libtool-bin
48+
libtool-bin \
49+
meson \
50+
valgrind
5051
5152
- name: Check out repository code
5253
uses: actions/checkout@v3
@@ -179,6 +180,7 @@ jobs:
179180
libtool \
180181
linux-headers \
181182
make \
183+
meson \
182184
musl-dev \
183185
pkgconfig
184186
@@ -193,7 +195,6 @@ jobs:
193195
run: |
194196
set -x
195197
196-
export CC="${{ matrix.cc }}"
197198
export CFLAGS="-DNL_MORE_ASSERTS=1000 -O2 -Werror -std=gnu11 -fexceptions"
198199
if [ "$CC" = "clang" ]; then
199200
CFLAGS="$CFLAGS -Wno-error=unused-command-line-argument -Wno-error=unused-function"
@@ -220,4 +221,5 @@ jobs:
220221
# (odd).
221222
# tests/check-all
222223
# make -j 15 check || (cat ./test-suite.log; false)
224+
make check-local-c-list
223225
done

Makefile.am

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ lib_LTLIBRARIES =
66
noinst_LTLIBRARIES =
77
check_LTLIBRARIES =
88

9+
clean_local =
910
check_PROGRAMS =
1011
check_programs =
1112
check_local =
@@ -1184,6 +1185,36 @@ endif
11841185

11851186
###############################################################################
11861187

1188+
EXTRA_DIST += \
1189+
third_party/c-list/AUTHORS \
1190+
third_party/c-list/.editorconfig \
1191+
third_party/c-list/.github/workflows/ci.yml \
1192+
third_party/c-list/meson.build \
1193+
third_party/c-list/NEWS.md \
1194+
third_party/c-list/README.md \
1195+
third_party/c-list/src/c-list.h \
1196+
third_party/c-list/src/meson.build \
1197+
third_party/c-list/src/test-api.c \
1198+
third_party/c-list/src/test-basic.c \
1199+
third_party/c-list/src/test-embed.c \
1200+
$(NULL)
1201+
1202+
check-local-c-list:
1203+
"$(srcdir)/tools/check-c-list.sh"
1204+
1205+
check_local += check-local-c-list
1206+
1207+
clean-local-c-list:
1208+
rm -rf ./build-c-list/
1209+
1210+
clean_local += clean-local-c-list
1211+
1212+
EXTRA_DIST += tools/check-c-list.sh
1213+
1214+
###############################################################################
1215+
1216+
clean-local: $(clean_local)
1217+
11871218
check-local: $(check_build) $(check_local)
11881219

11891220
.PHONY: $(check_local)

tools/check-c-list.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/bash
2+
3+
set -e
4+
5+
print_and_exit() {
6+
local err="$1"
7+
shift
8+
printf '%s\n' "$*"
9+
exit "$err"
10+
}
11+
12+
die() {
13+
print_and_exit 1 "$@"
14+
}
15+
16+
command -v meson &>/dev/null || print_and_exit 0 "$0: skip: meson not available"
17+
command -v ninja &>/dev/null || print_and_exit 0 "$0: skip: ninja not available"
18+
19+
BUILDDIR="$PWD"
20+
SRCDIR="$(dirname "$0")/.."
21+
22+
_BUILDDIR="$BUILDDIR/build-c-list"
23+
_SRCDIR="$SRCDIR/third_party/c-list"
24+
25+
if [ ! -d "$_BUILDDIR" ] ; then
26+
meson setup "$_BUILDDIR" "$_SRCDIR" || die "meson failed"
27+
ninja -C "$_BUILDDIR" || die "failed build"
28+
fi
29+
30+
ninja -C "$_BUILDDIR" test || die "c-list tests failed"

0 commit comments

Comments
 (0)