$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',
$tmp_socket_path = "/tmp/nested-$ENV{DISPLAY}";
+ $args{dont_create_temp_dir} //= 0;
+
my ($fh, $tmpfile) = tempfile("i3-cfg-for-$ENV{TESTNAME}-XXXXX", UNLINK => 1);
if ($config ne '-default') {
strace => $ENV{STRACE},
restart => $ENV{RESTART},
cv => $cv,
+ dont_create_temp_dir => $args{dont_create_temp_dir},
);
# force update of the cached socket path in lib/i3test
# See which files exist in /tmp before to not mistakenly check an already
# existing tmpdir of another i3 instance.
my @files_before = </tmp/i3-*>;
-my $pid = launch_with_config($config, dont_add_socket_path => 1);
+my $pid = launch_with_config($config, dont_add_socket_path => 1, dont_create_temp_dir => 1);
my @files_after = </tmp/i3-*>;
@files_after = grep { !($_ ~~ @files_before) } @files_after;
$ENV{XDG_RUNTIME_DIR} = $rtdir;
-$pid = launch_with_config($config, dont_add_socket_path => 1);
+$pid = launch_with_config($config, dont_add_socket_path => 1, dont_create_temp_dir => 1);
ok(-d "$rtdir/i3", "$rtdir/i3 exists and is a directory");
$socketpath = "$rtdir/i3/ipc-socket." . $pid;
ipc-socket $socketpath
EOT
-$pid = launch_with_config($config, dont_add_socket_path => 1);
+$pid = launch_with_config($config, dont_add_socket_path => 1, dont_create_temp_dir => 1);
ok(-S $socketpath, "file $socketpath exists and is a socket");