tests: Make i3 create its temporary files in /tmp/i3-testsuite

This behavior can be avoided by passing dont_create_temp_dir => 1 to
launch_with_config (or activate_i3).

This commit fixes t/159-socketpaths.t being flaky on non-systemd computers.
This commit is contained in:
Michael Stapelberg
2012-01-30 15:51:48 +00:00
parent c1e0c38b27
commit efa1cada29
3 changed files with 10 additions and 3 deletions

View File

@ -52,6 +52,10 @@ sub activate_i3 {
$ENV{LISTEN_PID} = $$;
$ENV{LISTEN_FDS} = 1;
delete $ENV{DESKTOP_STARTUP_ID};
unless ($args{dont_create_temp_dir}) {
$ENV{XDG_RUNTIME_DIR} = '/tmp/i3-testsuite/';
mkdir $ENV{XDG_RUNTIME_DIR};
}
$ENV{DISPLAY} = $args{display};
$ENV{PATH} = join(':',
'../i3-nagbar',