wireplumber: Fix scripts ptests after the 0.5.19 upgrade

0.5.19 moved the script tests into subdirectories, so ptest-list now
has entries like linking/non-default-device-node.lua. run-ptest
redirects each test's output to $arg2.out, and that directory does not
exist next to script-tester, so the redirection fails, script-tester
never runs and all 28 tests are reported as failed.

Flatten the path for the output file name.

The new node/suspend-* tests also require suspend-test-utils, which
upstream finds through WIREPLUMBER_DATA_DIR in the source tree. Install
it next to test-utils.lua.

All 64 tests pass on qemux86-64.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
Khem Raj committed 2026-11-09 08:17:20 -08:00
1 parent dfad8e27be
commit 33db795031
2 files changed
+3 -2

No files matched your search

@@ -16,7 +16,7 @@ run_scripted_test(){
while read line; do
arg1=$(echo $line | cut -f1 -d" ")
arg2=$(echo $line | cut -f2 -d" ")
if ./script-tester $arg1 scripts/$arg2 > $arg2.out 2>&1; then
if ./script-tester $arg1 scripts/$arg2 > $(echo $arg2 | tr / _).out 2>&1; then
echo PASS: $arg2
else
echo FAIL: $arg2
@@ -77,6 +77,7 @@ do_install_ptest() {
install -m 644 ${S}/src/config/wireplumber.conf ${D}${PTEST_PATH}/data/config/
install -Dm 644 ${S}/tests/wplua/scripts/lib/testlib.lua ${D}${datadir}/wireplumber/scripts/lib/testlib.lua
install -Dm 644 ${S}/tests/scripts/scripts/lib/test-utils.lua ${D}${datadir}/wireplumber/scripts/lib/test-utils.lua
install -Dm 644 ${S}/tests/scripts/scripts/lib/suspend-test-utils.lua ${D}${datadir}/wireplumber/scripts/lib/suspend-test-utils.lua
# this is not a test
rm -rf ${D}${PTEST_PATH}/examples
@@ -176,7 +177,7 @@ FILES:${PN}-scripts += "${datadir}/wireplumber/scripts/*"
FILES:${PN}-modules = ""
RRECOMMENDS:${PN}-modules += "${PN}-modules-meta"
FILES:${PN}-ptest += "${datadir}/wireplumber/scripts/lib/test-utils.lua ${datadir}/wireplumber/scripts/testlib.lua"
FILES:${PN}-ptest += "${datadir}/wireplumber/scripts/lib/test-utils.lua ${datadir}/wireplumber/scripts/lib/suspend-test-utils.lua ${datadir}/wireplumber/scripts/testlib.lua"
RDEPENDS:${PN}-ptest += "pipewire-modules-protocol-native ${PN}-scripts \
${@'dbus' if d.getVar('WP_DBUS_TESTS') == 'true' else ''} \
"