File: settestenv.sh

package info (click to toggle)
syncthingtray 1.7.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,804 kB
  • sloc: cpp: 31,085; xml: 1,694; java: 570; sh: 81; javascript: 53; makefile: 25
file content (30 lines) | stat: -rwxr-xr-x 1,205 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
set -e

# use a sub directory within the build directory which is supposed to be $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/*syncthingplasmoid*.so ]; then
        export QT_PLUGIN_PATH=$PWD/syncthingtray/plasmoid/lib
    elif [ -f "$PWD"/plasmoid/lib/plasma/applets/*syncthingplasmoid*.so ]; then
        export QT_PLUGIN_PATH=$PWD/plasmoid/lib
    fi
fi
echo "QT_PLUGIN_PATH used for Plasmoid testing: $QT_PLUGIN_PATH"

# set TEST_FILE_PATH so files for the mocked configuration can be found
export TEST_FILE_PATH=$(dirname "${BASH_SOURCE[0]}")/../testfiles

# log working directory
echo "Working directory used for Plasmoid testing: $PWD"

# debug plugin loading (run this script from terminal if Qt Creator suppresses the debugging output)
export QT_DEBUG_PLUGINS=1