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

@ -15,6 +15,7 @@ my $x = X11::XCB::Connection->new;
# assuming we are run by complete-run.pl
my $i3_path = abs_path("../i3");
my $socketpath = File::Temp::tempnam('/tmp', 'i3-test-socket-');
#####################################################################
# 1: test the wrapping behaviour without force_focus_wrapping
@ -23,7 +24,7 @@ my $i3_path = abs_path("../i3");
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");
@ -31,6 +32,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;
@ -69,7 +73,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 "force_focus_wrapping true";
close($fh);
@ -78,6 +82,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;