Skip to content

Commit 54a22cf

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

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 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

Makefile.am

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,15 @@ endif
11841184

11851185
###############################################################################
11861186

1187+
check-local-c-list:
1188+
./tools/check-c-list.sh
1189+
1190+
check_local += check-local-c-list
1191+
1192+
EXTRA_DIST += tools/check-c-list.sh
1193+
1194+
###############################################################################
1195+
11871196
check-local: $(check_build) $(check_local)
11881197

11891198
.PHONY: $(check_local)

tools/check-c-list.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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 "skip: meson not available"
17+
command -v ninja &>/dev/null || print_and_exit 0 "skip: ninja not available"
18+
19+
cd ./third_party/c-list/
20+
21+
if [ ! -d "./build/" ] ; then
22+
meson ./build/ || die "meson failed"
23+
ninja -C ./build/ || die "failed build"
24+
fi
25+
26+
ninja -C ./build/ test || die "c-list tests failed"

0 commit comments

Comments
 (0)