syncthingtray/plasmoid/scripts/settestenv.sh
Martchus 80704e0028 Adapt test environment for Plasmoid
Apparently just setting HOME does not work anymore. At least in my Plasma
setup XDG_DATA_HOME and XDG_CONFIG_HOME are now interfering. This change
introduced an extra helper script to take care of the environment variables
which unsets the XDG_… variables and also takes care of QT_PLUGIN_PATH by
the way.
2020-08-18 01:20:06 +02:00

23 lines
872 B
Bash
Executable File

#!/bin/bash
set -e
# use a sub directory within the build directory which is supposed to be $PWD
echo $PWD
export HOME=${TEST_HOME:-$PWD/plasmoid-testing}
echo "HOME directory used for Plasmoid testing: $HOME"
mkdir -p "$HOME"
# unset XDG_DATA_HOME and XDG_CONFIG_HOME to use Qt's default relying on just HOME (see qtbase/src/corelib/io/qstandardpaths_unix.cpp for defaults)
export XDG_DATA_HOME=
export XDG_CONFIG_HOME=
# set QT_PLUGIN_PATH if it has not already been set
if ! [[ $QT_PLUGIN_PATH ]]; then
if [[ -f $PWD/syncthingtray/plasmoid/lib/plasma/applets/libsyncthingplasmoid.so ]]; then
export QT_PLUGIN_PATH=$PWD/syncthingtray/plasmoid/lib
elif [[ -f $PWD/plasmoid/lib/plasma/applets/libsyncthingplasmoid.so ]]; then
export QT_PLUGIN_PATH=$PWD/plasmoid/lib
fi
echo "QT_PLUGIN_PATH used for Plasmoid testing: $QT_PLUGIN_PATH"
fi