diff options
| author | Gyorgy Sarvari <skandigraun@gmail.com> | 2025-12-24 21:55:16 +0100 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2025-12-24 13:19:13 -0800 |
| commit | f3862b744197c02393197e28c1fa426455f8a7e2 (patch) | |
| tree | d906f890259dfbcee579dae9fcac9f05c80fbff2 | |
| parent | ca7fe11935982bcbb8bf10b80c4b17a381190fb3 (diff) | |
| download | meta-openembedded-f3862b744197c02393197e28c1fa426455f8a7e2.tar.gz | |
wireplumber: add ptest support
Execution takes <10s.
Sample output:
root@qemux86-64:~# ptest-runner
START: ptest-runner
2025-12-24T19:17
BEGIN: /usr/lib/wireplumber/ptest
PASS: ./wp/test-spa-json
PASS: ./wp/test-spa-pod
PASS: ./wp/test-spa-type
PASS: ./wp/test-properties
PASS: ./wp/test-core
PASS: ./wp/test-session-item
PASS: ./wp/test-json-utils
PASS: ./wp/test-events
PASS: ./wp/test-conf
PASS: ./wp/test-transition
PASS: ./wp/test-object-interest
PASS: ./wp/test-metadata
PASS: ./wp/test-object-manager
PASS: ./wp/test-factory
PASS: ./wp/test-settings
PASS: ./wp/test-proxy
PASS: ./wp/test-state
PASS: ./wp/test-component-loader
PASS: 00-test-linking-non-default-device-node.lua
PASS: 01-test-linking-non-default-device-node-capture.lua
PASS: 02-test-linking-default-device-node.lua
PASS: 03-test-linking-default-device-node-capture.lua
PASS: 04-test-linking-defined-device-node-target-object-string.lua
PASS: 05-test-linking-defined-device-node-target-object-int.lua
PASS: 06-test-linking-defined-device-node-target-object-name.lua
PASS: 07-test-linking-defined-device-node-target-object-string-capture.lua
PASS: 08-test-linking-defined-device-node-target-object-int-capture.lua
PASS: 09-test-linking-defined-device-node-target-object-name-capture.lua
PASS: 10-test-linking-defined-device-node-node-target.lua
PASS: 11-test-linking-defined-device-node-node-target-capture.lua
PASS: 12-test-linking-defined-device-node-target-node-metadata.lua
PASS: 13-test-linking-defined-device-node-target-node-metadata-capture.lua
PASS: 14-test-linking-defined-device-node-target-object-metadata.lua
PASS: 15-test-linking-defined-device-node-target-object-metadata-capture.lua
PASS: 16-test-linking-defined-device-node-target-object-int-metadata.lua
PASS: 17-test-linking-defined-device-node-target-object-int-metadata-capture.lua
PASS: 00-test-default-nodes-initial-metadata-update.lua
/usr/lib/wireplumber/ptest
PASS: pod.lua
PASS: json.lua
PASS: json-utils.lua
PASS: monitor-rules.lua
PASS: require.lua
PASS: async-activation.lua
PASS: settings.lua
PASS: event-hooks.lua
PASS: properties.lua
/usr/lib/wireplumber/ptest
PASS: ./wplua/test-wplua
PASS: ./modules/test-file-monitor
PASS: ./modules/test-si-node
PASS: ./modules/test-si-standard-link
PASS: ./modules/test-dbus-connection
PASS: ./modules/test-si-audio-adapter
PASS: ./modules/test-reserve-device
DURATION: 1
END: /usr/lib/wireplumber/ptest
2025-12-24T19:17
STOP: ptest-runner
TOTAL: 1 FAIL: 0
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
3 files changed, 88 insertions, 3 deletions
diff --git a/meta-multimedia/conf/include/ptest-packagelists-meta-multimedia.inc b/meta-multimedia/conf/include/ptest-packagelists-meta-multimedia.inc index ba511b9ed5..0b1b4afba8 100644 --- a/meta-multimedia/conf/include/ptest-packagelists-meta-multimedia.inc +++ b/meta-multimedia/conf/include/ptest-packagelists-meta-multimedia.inc | |||
| @@ -12,7 +12,8 @@ PTESTS_FAST_META_MULTIMEDIA = "\ | |||
| 12 | gupnp-av \ | 12 | gupnp-av \ |
| 13 | gupnp-igd \ | 13 | gupnp-igd \ |
| 14 | libmediaart-2.0 \ | 14 | libmediaart-2.0 \ |
| 15 | libopenmpt\ | 15 | libopenmpt \ |
| 16 | wireplumber \ | ||
| 16 | " | 17 | " |
| 17 | 18 | ||
| 18 | PTESTS_SLOW_META_MULTIMEDIA = "\ | 19 | PTESTS_SLOW_META_MULTIMEDIA = "\ |
diff --git a/meta-multimedia/recipes-multimedia/wireplumber/files/run-ptest b/meta-multimedia/recipes-multimedia/wireplumber/files/run-ptest new file mode 100644 index 0000000000..a3682bd2b0 --- /dev/null +++ b/meta-multimedia/recipes-multimedia/wireplumber/files/run-ptest | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | RET=0 | ||
| 3 | |||
| 4 | export HOME=/invalid | ||
| 5 | export XDG_RUNTIME_DIR=/invalid | ||
| 6 | export PIPEWIRE_RUNTIME_DIR=/tmp | ||
| 7 | export XDG_CONFIG_HOME=$(pwd)/.config | ||
| 8 | export XDG_STATE_HOME=$(pwd)/.local/state | ||
| 9 | export FILE_MONITOR_DIR=$(pwd)/.local/file_monitor | ||
| 10 | export WIREPLUMBER_MODULE_DIR=/usr/lib/wireplumber-0.5 | ||
| 11 | export G_TEST_SRCDIR=/usr/lib/wireplumber/ptest/data | ||
| 12 | |||
| 13 | run_scripted_test(){ | ||
| 14 | test_dir=$(dirname $1) | ||
| 15 | cd $test_dir | ||
| 16 | while read line; do | ||
| 17 | arg1=$(echo $line | cut -f1 -d" ") | ||
| 18 | arg2=$(echo $line | cut -f2 -d" ") | ||
| 19 | if ./script-tester $arg1 scripts/$arg2 > $arg2.out 2>&1; then | ||
| 20 | echo PASS: $arg2 | ||
| 21 | else | ||
| 22 | echo FAIL: $arg2 | ||
| 23 | RET=1 | ||
| 24 | fi | ||
| 25 | done < ./ptest-list | ||
| 26 | cd - | ||
| 27 | } | ||
| 28 | |||
| 29 | run_regular_test(){ | ||
| 30 | if ./$1 > $1.out 2>&1; then | ||
| 31 | echo PASS: $1 | ||
| 32 | else | ||
| 33 | echo FAIL: $1 | ||
| 34 | RET=1 | ||
| 35 | fi | ||
| 36 | } | ||
| 37 | |||
| 38 | run_test(){ | ||
| 39 | case $1 in | ||
| 40 | *run-ptest) | ||
| 41 | ;; | ||
| 42 | *script-tester) | ||
| 43 | run_scripted_test $1 | ||
| 44 | ;; | ||
| 45 | *) | ||
| 46 | run_regular_test $1 | ||
| 47 | ;; | ||
| 48 | esac | ||
| 49 | } | ||
| 50 | |||
| 51 | |||
| 52 | for t in $(find . -type f -executable); do | ||
| 53 | run_test $t | ||
| 54 | done | ||
| 55 | exit $RET | ||
diff --git a/meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.5.13.bb b/meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.5.13.bb index b497d51e96..abd54515ca 100644 --- a/meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.5.13.bb +++ b/meta-multimedia/recipes-multimedia/wireplumber/wireplumber_0.5.13.bb | |||
| @@ -13,11 +13,12 @@ DEPENDS = "glib-2.0 glib-2.0-native lua pipewire \ | |||
| 13 | SRCREV = "84429b47943d789389fbde17c06b82efb197d04e" | 13 | SRCREV = "84429b47943d789389fbde17c06b82efb197d04e" |
| 14 | SRC_URI = " \ | 14 | SRC_URI = " \ |
| 15 | git://gitlab.freedesktop.org/pipewire/wireplumber.git;branch=master;protocol=https;tag=${PV} \ | 15 | git://gitlab.freedesktop.org/pipewire/wireplumber.git;branch=master;protocol=https;tag=${PV} \ |
| 16 | file://run-ptest \ | ||
| 16 | file://90-OE-disable-session-dbus-dependent-features.lua \ | 17 | file://90-OE-disable-session-dbus-dependent-features.lua \ |
| 17 | " | 18 | " |
| 18 | 19 | ||
| 19 | 20 | ||
| 20 | inherit meson pkgconfig gobject-introspection systemd bash-completion | 21 | inherit meson pkgconfig gobject-introspection systemd bash-completion ptest |
| 21 | 22 | ||
| 22 | GIR_MESON_ENABLE_FLAG = 'enabled' | 23 | GIR_MESON_ENABLE_FLAG = 'enabled' |
| 23 | GIR_MESON_DISABLE_FLAG = 'disabled' | 24 | GIR_MESON_DISABLE_FLAG = 'disabled' |
| @@ -31,11 +32,11 @@ EXTRA_OEMESON += " \ | |||
| 31 | -Delogind=disabled \ | 32 | -Delogind=disabled \ |
| 32 | -Dsystemd-system-unit-dir=${systemd_system_unitdir} \ | 33 | -Dsystemd-system-unit-dir=${systemd_system_unitdir} \ |
| 33 | -Dsystemd-user-unit-dir=${systemd_user_unitdir} \ | 34 | -Dsystemd-user-unit-dir=${systemd_user_unitdir} \ |
| 34 | -Dtests=false \ | ||
| 35 | " | 35 | " |
| 36 | 36 | ||
| 37 | PACKAGECONFIG ??= " dbus \ | 37 | PACKAGECONFIG ??= " dbus \ |
| 38 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd systemd-system-service systemd-user-service', '', d)} \ | 38 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd systemd-system-service systemd-user-service', '', d)} \ |
| 39 | ${@bb.utils.contains('PTEST_ENABLED', '1', 'test', '', d)} \ | ||
| 39 | " | 40 | " |
| 40 | 41 | ||
| 41 | PACKAGECONFIG[systemd] = "-Dsystemd=enabled,-Dsystemd=disabled,systemd" | 42 | PACKAGECONFIG[systemd] = "-Dsystemd=enabled,-Dsystemd=disabled,systemd" |
| @@ -45,6 +46,7 @@ PACKAGECONFIG[systemd-system-service] = "-Dsystemd-system-service=true,-Dsystemd | |||
| 45 | # currently lacks the feature of enabling user services. | 46 | # currently lacks the feature of enabling user services. |
| 46 | PACKAGECONFIG[systemd-user-service] = "-Dsystemd-user-service=true,-Dsystemd-user-service=false,systemd" | 47 | PACKAGECONFIG[systemd-user-service] = "-Dsystemd-user-service=true,-Dsystemd-user-service=false,systemd" |
| 47 | PACKAGECONFIG[dbus] = "" | 48 | PACKAGECONFIG[dbus] = "" |
| 49 | PACKAGECONFIG[test] = "-Dtests=true,-Dtests=false" | ||
| 48 | 50 | ||
| 49 | PACKAGESPLITFUNCS:prepend = " split_dynamic_packages " | 51 | PACKAGESPLITFUNCS:prepend = " split_dynamic_packages " |
| 50 | PACKAGESPLITFUNCS:append = " set_dynamic_metapkg_rdepends " | 52 | PACKAGESPLITFUNCS:append = " set_dynamic_metapkg_rdepends " |
| @@ -57,6 +59,30 @@ do_install:append() { | |||
| 57 | fi | 59 | fi |
| 58 | } | 60 | } |
| 59 | 61 | ||
| 62 | do_install_ptest() { | ||
| 63 | install -d ${D}${PTEST_PATH}/data/config | ||
| 64 | cd ${B}/tests | ||
| 65 | find . -maxdepth 2 -type f -executable -exec install -D {} ${D}${PTEST_PATH}/{} \; | ||
| 66 | |||
| 67 | install -m 644 ${S}/tests/wp/component-loader.conf ${D}${PTEST_PATH}/data/ | ||
| 68 | cp -r ${S}/tests/scripts/scripts ${D}${PTEST_PATH}/scripts/ | ||
| 69 | cp -r ${S}/tests/wplua/scripts ${D}${PTEST_PATH}/wplua/ | ||
| 70 | cp -r ${S}/tests/wp/conf ${D}${PTEST_PATH}/data | ||
| 71 | cp -r ${S}/tests/wp/settings ${D}${PTEST_PATH}/data | ||
| 72 | install -m 644 ${S}/src/config/wireplumber.conf ${D}${PTEST_PATH}/data/config/ | ||
| 73 | install -Dm 644 ${S}/tests/wplua/scripts/lib/testlib.lua ${D}${datadir}/wireplumber/scripts/lib/testlib.lua | ||
| 74 | install -Dm 644 ${S}/tests/scripts/scripts/lib/test-utils.lua ${D}${datadir}/wireplumber/scripts/lib/test-utils.lua | ||
| 75 | |||
| 76 | # this is not a test | ||
| 77 | rm -rf ${D}${PTEST_PATH}/examples | ||
| 78 | |||
| 79 | # Beside regular bianry executables, this package comes with lua tests also | ||
| 80 | # which need to be executed with specific parameters. Take the parameters | ||
| 81 | # from the meson.build files, and read them from run-ptest script. | ||
| 82 | grep args ${S}/tests/wplua/meson.build | cut -d[ -f2 | cut -d] -f1 | tr -d ",'" > ${D}${PTEST_PATH}/wplua/ptest-list | ||
| 83 | grep args ${S}/tests/scripts/meson.build | cut -d[ -f2 | cut -d] -f1 | tr -d ",'" > ${D}${PTEST_PATH}/scripts/ptest-list | ||
| 84 | } | ||
| 85 | |||
| 60 | python split_dynamic_packages () { | 86 | python split_dynamic_packages () { |
| 61 | # Create packages for each WirePlumber module. | 87 | # Create packages for each WirePlumber module. |
| 62 | wp_module_libdir = d.expand('${libdir}/${WP_MODULE_SUBDIR}') | 88 | wp_module_libdir = d.expand('${libdir}/${WP_MODULE_SUBDIR}') |
| @@ -142,3 +168,6 @@ FILES:${PN}-scripts += "${datadir}/wireplumber/scripts/*" | |||
| 142 | # Dynamic packages (see set_dynamic_metapkg_rdepends). | 168 | # Dynamic packages (see set_dynamic_metapkg_rdepends). |
| 143 | FILES:${PN}-modules = "" | 169 | FILES:${PN}-modules = "" |
| 144 | RRECOMMENDS:${PN}-modules += "${PN}-modules-meta" | 170 | RRECOMMENDS:${PN}-modules += "${PN}-modules-meta" |
| 171 | |||
| 172 | FILES:${PN}-ptest += "${datadir}/wireplumber/scripts/lib/test-utils.lua ${datadir}/wireplumber/scripts/testlib.lua" | ||
| 173 | RDEPENDS:${PN}-ptest += "pipewire-modules-protocol-native ${PN}-scripts" | ||
