tests: improve test purity

Before the XDG variables would be set from the user's environment, if
available. This would break some tests.

With this change the tests should be fully deterministic.

Fixes #1190
This commit is contained in:
Robert Helgesson 2020-04-24 21:41:22 +02:00
parent cfaf213980
commit 95b95b1407
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
17 changed files with 21 additions and 54 deletions

View file

@ -1,5 +0,0 @@
# Only source this once.
if [ -n "$__HM_SESS_VARS_SOURCED" ]; then return; fi
export __HM_SESS_VARS_SOURCED=1
export TMUX_TMPDIR="${XDG_RUNTIME_DIR:-"/run/user/\$(id -u)"}"

View file

@ -11,9 +11,8 @@ with lib;
nmt.script = ''
assertFileExists home-path/etc/profile.d/hm-session-vars.sh
assertFileContent home-path/etc/profile.d/hm-session-vars.sh ${
./hm-session-vars.sh
}
assertFileContains home-path/etc/profile.d/hm-session-vars.sh \
'export TMUX_TMPDIR="''${XDG_RUNTIME_DIR:-"/run/user/\$(id -u)"}"'
'';
};
}