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 fe4d163
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,13 @@ endif

###############################################################################

check-local-c-list:
./tools/check-c-list.sh

check_local += check-local-c-list

###############################################################################

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 fe4d163

Please sign in to comment.