Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v4
- name: build
run: |
scripts/build.sh -b ${{ matrix.buildtype }} -c ${{ matrix.compiler }}
scripts/build.sh -b ${{ matrix.buildtype }} -c ${{ matrix.compiler }} -x
- uses: actions/upload-artifact@v4
name: upload logs
if: failure()
Expand Down
21 changes: 18 additions & 3 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ usage() {
echo " -c [gcc]|clang compiler to use"
echo " -m [meson]|muon use meson or muon"
echo " -t [armhf]|ppc64le|s390x cross compile target"
echo " -x run test with valgrind"
echo ""
echo "configs with meson:"
echo " [default] default settings"
Expand All @@ -33,7 +34,9 @@ BUILDTYPE=release
CROSS_TARGET=armhf
CC=${CC:-"gcc"}

while getopts "b:c:m:t:" o; do
use_valgrind=0

while getopts "b:c:m:t:x" o; do
case "${o}" in
b)
BUILDTYPE="${OPTARG}"
Expand All @@ -47,6 +50,9 @@ while getopts "b:c:m:t:" o; do
t)
CROSS_TARGET="${OPTARG}"
;;
x)
use_valgrind=1
;;
*)
usage
exit 1
Expand Down Expand Up @@ -125,8 +131,17 @@ build_meson() {
}

test_meson() {
"${MESON}" test \
-C "${BUILDDIR}"
local args=(-C "${BUILDDIR}")

if [ "${use_valgrind:-0}" -eq 1 ]; then
if command -v valgrind >/dev/null 2>&1; then
args+=(--wrapper valgrind)
else
echo "Warning: valgrind requested but not found; running without it." >&2
fi
fi

"${MESON}" test "${args[@]}"
}

test_meson_coverage() {
Expand Down