tests: get the socket path from the X11 atom I3_SOCKET_PATH

The hard-coded socket paths are not useful when running the test suite in
parallel.
This commit is contained in:
Michael Stapelberg
2011-07-25 13:35:56 +02:00
parent 18513e1638
commit 49ea805905
33 changed files with 91 additions and 46 deletions

View File

@ -22,10 +22,12 @@ my $i3_path = abs_path("../i3");
# other and no split containers are created
#####################################################################
my $socketpath = File::Temp::tempnam('/tmp', 'i3-test-socket-');
my ($fh, $tmpfile) = tempfile();
say $fh "# i3 config file (v4)";
say $fh "font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1";
say $fh "ipc-socket /tmp/nestedcons";
say $fh "ipc-socket $socketpath";
close($fh);
diag("Starting i3");
@ -33,6 +35,9 @@ my $i3cmd = "exec " . abs_path("../i3") . " -V -d all --disable-signalhandler -c
my $process = Proc::Background->new($i3cmd);
sleep 1;
# force update of the cached socket path in lib/i3test
get_socket_path(0);
diag("pid = " . $process->pid);
my $tmp = fresh_workspace;
@ -57,7 +62,7 @@ exit_gracefully($process->pid);
($fh, $tmpfile) = tempfile();
say $fh "# i3 config file (v4)";
say $fh "font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1";
say $fh "ipc-socket /tmp/nestedcons";
say $fh "ipc-socket $socketpath";
say $fh "workspace_layout stacked";
close($fh);
@ -66,6 +71,9 @@ $i3cmd = "exec " . abs_path("../i3") . " -V -d all --disable-signalhandler -c $t
$process = Proc::Background->new($i3cmd);
sleep 1;
# force update of the cached socket path in lib/i3test
get_socket_path(0);
diag("pid = " . $process->pid);
$tmp = fresh_workspace;