tests: set PIPEWIRE_RUNTIME_DIR and stop using XDG_RUNTIME_DIR

Using XDG_RUNTIME_DIR is problematic in test-reserve-device
because GTestDBus also exports XDG_RUNTIME_DIR and then unsets it,
which makes pipewire end up using $HOME for its socket.
Using PIPEWIRE_RUNTIME_DIR is safer, as this variable is only used
by pipewire.

Also use the build directory as a runtime dir (it always exists and
nothing is going to interfere with it) and unset XDG_RUNTIME_DIR from
the CI scripts, since nothing else is using it.

Closes #39
This commit is contained in:
George Kiagiadakis 2021-06-30 11:47:00 +03:00
parent b741b2c8c8
commit d576fde2d7
2 changed files with 3 additions and 1 deletions

View file

@ -116,7 +116,6 @@ include:
- ninja -C "$PW_BUILD_DIR" install
# misc environment only for wireplumber
- export WP_BUILD_DIR="$PWD/build-wireplumber-$BUILD_ID"
- export XDG_RUNTIME_DIR="$(mktemp -p $PWD -d xdg-runtime-XXXXXX)"
- export PKG_CONFIG_PATH="$(dirname $(find "$PREFIX" -name 'libpipewire-*.pc')):$PKG_CONFIG_PATH"
script:
# Build wireplumber

View file

@ -30,6 +30,9 @@ endif
# The common test environment
common_test_env = environment({
'HOME': '/invalid',
'XDG_RUNTIME_DIR': '/invalid',
'PIPEWIRE_RUNTIME_DIR': meson.current_build_dir(),
'XDG_CONFIG_HOME': meson.current_build_dir() / '.config',
'WIREPLUMBER_CONFIG_DIR': '/invalid',
'WIREPLUMBER_DATA_DIR': '/invalid',