tests: Make it possible to use mesontest --test-args

This makes it possible to pass arguments to g_test_init via mesons
--test-args. This can be useful when one wants to run a single test with
`meson test testlibrary --test-args='-p /context'.
This commit is contained in:
Sebastian Wick 2025-08-25 13:11:03 +02:00
parent 9dccb7a722
commit 14bfb56ba3

View File

@ -6,6 +6,7 @@
srcd=$(cd $(dirname $1) && pwd)
bn=$(basename $1)
shift
tempdir=$(mktemp -d /tmp/tap-test.XXXXXX)
touch ${tempdir}/.testtmp
function cleanup () {
@ -21,4 +22,4 @@ cd ${tempdir}
if [[ $bn == *.wrap ]]; then
WRAPPER=${srcd}/test-wrapper.sh
fi
$WRAPPER ${srcd}/${bn} -k --tap
$WRAPPER ${srcd}/${bn} -k --tap "$@"