mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2026-02-07 04:07:06 -05:00
There's already a hook that modifies the search path when run from the
build tree.
if (pa_run_from_build_tree()) {
pa_log_notice("Detected that we are run from the build tree, fixing search path.");
#ifdef MESON_BUILD
c->dl_search_path = pa_xstrdup(PA_BUILDDIR PA_PATH_SEP "src" PA_PATH_SEP "modules");
#else
c->dl_search_path = pa_xstrdup(PA_BUILDDIR);
#endif
} else
I'm not sure how it works behind the hood, but by setting
--dl-search-path, we get errors in the logs when running `make
check-daemon`:
E: [pulseaudio][daemon/ltdl-bind-now.c:75 bind_now_open()] Failed to open module /home/arno/proj/pulse/src/pa.up/src/.libs/.libs/module-native-protocol-unix.so:
/home/arno/proj/pulse/src/pa.up/src/.libs/.libs/module-native-protocol-unix.so: cannot open shared object file: No such file or directory
I: [pulseaudio][pulsecore/module.c:197 pa_module_load()] Loaded "module-native-protocol-unix" (index: #3; argument: "").
So basically, PA tries two paths, fails the first time (obviously we can
see the path is not correct), then tries again with another path (where
does it gets it?) and succeeds. So there's no obvious error if you don't
look at the log.
This commit removes the useless `--dl-search-path`, which has the effect
to remove the errors in the logs.
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
72 lines
1.7 KiB
Bash
Executable file
72 lines
1.7 KiB
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# This script is modified from dbus's run-with-temp-session-bus.sh.
|
|
#
|
|
|
|
SCRIPTNAME="$0"
|
|
|
|
die()
|
|
{
|
|
if ! test -z "$DBUS_SESSION_BUS_PID" ; then
|
|
echo "killing message bus "$DBUS_SESSION_BUS_PID >&2
|
|
kill -9 $DBUS_SESSION_BUS_PID
|
|
fi
|
|
echo $SCRIPTNAME: $* >&2
|
|
exit 1
|
|
}
|
|
|
|
## convenient to be able to ctrl+C without leaking the message bus process
|
|
trap 'die "Received SIGINT"' INT
|
|
|
|
unset DBUS_SESSION_BUS_ADDRESS
|
|
unset DBUS_SESSION_BUS_PID
|
|
|
|
echo "Running dbus-launch --sh-syntax" >&2
|
|
|
|
eval `dbus-launch --sh-syntax`
|
|
|
|
if test -z "$DBUS_SESSION_BUS_PID" ; then
|
|
die "Failed to launch message bus for test script to run"
|
|
fi
|
|
|
|
echo "Started bus pid $DBUS_SESSION_BUS_PID at $DBUS_SESSION_BUS_ADDRESS" >&2
|
|
|
|
TEMP_PULSE_DIR=`mktemp -d`
|
|
export PULSE_RUNTIME_PATH=${TEMP_PULSE_DIR}
|
|
|
|
# this script would be called inside src/ directory, so we need to use the correct path.
|
|
# notice that for tests, we don't load ALSA related modules.
|
|
pulseaudio -n \
|
|
--log-target=file:${PWD}/pulse-daemon.log \
|
|
--log-level=debug \
|
|
--load="module-null-sink" \
|
|
--load="module-null-source" \
|
|
--load="module-suspend-on-idle" \
|
|
--load="module-native-protocol-unix" \
|
|
--load="module-cli-protocol-unix" \
|
|
&
|
|
|
|
# wait a few seconds to let the daemon start!
|
|
sleep 2
|
|
|
|
unset DISPLAY
|
|
|
|
EXIT_CODE=0
|
|
|
|
for ONE_TEST in $@; do
|
|
${ONE_TEST} || EXIT_CODE=1
|
|
done
|
|
|
|
# terminate the designated pulseaudio daemon
|
|
pacmd exit
|
|
|
|
wait
|
|
|
|
kill -TERM $DBUS_SESSION_BUS_PID || die "Message bus vanished! should not have happened" && echo "Killed daemon $DBUS_SESSION_BUS_PID" >&2
|
|
|
|
sleep 2
|
|
|
|
## be sure it really died
|
|
kill -9 $DBUS_SESSION_BUS_PID > /dev/null 2>&1 || true
|
|
|
|
exit $EXIT_CODE
|