]> git.sur5r.net Git - i3/i3/commitdiff
tests: use i3_config arg instead of precisely one launch_with_config
authorMichael Stapelberg <michael@stapelberg.de>
Thu, 14 Sep 2017 10:30:42 +0000 (12:30 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 19 Sep 2017 14:13:21 +0000 (16:13 +0200)
This way, tests are shorter, and i3test’s invocation of launch_with_config
parallelizes work better, using dont_block => 1.

61 files changed:
testcases/lib/SocketActivation.pm
testcases/lib/i3test.pm.in
testcases/t/156-fullscreen-focus.t
testcases/t/186-regress-assign-focus-parent.t
testcases/t/199-ipc-mode-event.t
testcases/t/200-urgency-timer.t
testcases/t/207-shmlog.t
testcases/t/208-regress-floating-criteria.t
testcases/t/211-regress-urgency-assign.t
testcases/t/222-regress-dock-resize.t
testcases/t/230-floating-fullscreen-restart.t
testcases/t/233-regress-manage-focus-unmapped.t
testcases/t/237-regress-assign-focus.t
testcases/t/241-consistent-center.t
testcases/t/244-new-workspace-floating-enable-center.t
testcases/t/248-regress-urgency-clear.t
testcases/t/254-move-to-output-with-criteria.t
testcases/t/257-keypress-group1-fallback.t
testcases/t/258-keypress-release.t
testcases/t/263-config-reload-reverts-bind-mode.t
testcases/t/264-dock-criteria.t
testcases/t/271-for_window_tilingfloating.t
testcases/t/272-regress-focus-assign.t
testcases/t/279-regress-default-floating-border.t
testcases/t/280-wm-class-change-handler.t
testcases/t/281-regress-reload-bindsym.t
testcases/t/282-tabbed-floating-disable-crash.t
testcases/t/286-root-window-mouse-binding.t
testcases/t/291-swap.t
testcases/t/500-multi-monitor.t
testcases/t/501-scratchpad.t
testcases/t/502-focus-output.t
testcases/t/503-workspace.t
testcases/t/504-move-workspace-to-output.t
testcases/t/505-scratchpad-resolution.t
testcases/t/507-workspace-move-crash.t
testcases/t/509-workspace_layout.t
testcases/t/510-focus-across-outputs.t
testcases/t/511-scratchpad-configure-request.t
testcases/t/512-move-wraps.t
testcases/t/513-move-workspace.t
testcases/t/514-ipc-workspace-multi-monitor.t
testcases/t/515-create-workspace.t
testcases/t/516-move.t
testcases/t/517-regress-move-direction-ipc.t
testcases/t/518-interpret-workspace-numbers.t
testcases/t/519-mouse-warping.t
testcases/t/520-regress-focus-direction-floating.t
testcases/t/521-ewmh-desktop-viewport.t
testcases/t/522-rename-assigned-workspace.t
testcases/t/523-move-position-center.t
testcases/t/524-move.t
testcases/t/525-i3bar-mouse-bindings.t
testcases/t/526-reconfigure-dock.t
testcases/t/528-workspace-next-prev-reversed.t
testcases/t/529-net-wm-desktop.t
testcases/t/530-bug-2229.t
testcases/t/531-fullscreen-on-given-output.t
testcases/t/534-dont-warp.t
testcases/t/535-workspace-next-prev.t
testcases/t/536-net-wm-desktop_mm.t

index 5951fd2663c6bb9e415db13750da670a346af132..5a5a4484262b349e7c8c808b9711e9f84222441c 100644 (file)
@@ -49,6 +49,11 @@ sub activate_i3 {
         die "could not fork()";
     }
     if ($pid == 0) {
+        # Start a process group so that in the parent, we can kill the entire
+        # process group and immediately kill i3bar and any other child
+        # processes.
+        setpgrp;
+
         $ENV{LISTEN_PID} = $$;
         $ENV{LISTEN_FDS} = 1;
         delete $ENV{DESKTOP_STARTUP_ID};
index 0f28a7a9f9e32b70b3acb864bcd01789520966c0..a9cfba37710ba897389a8d62491e695dc634c9e6 100644 (file)
@@ -126,7 +126,7 @@ END {
         exit_gracefully($i3_pid, "/tmp/nested-$ENV{DISPLAY}");
 
     } else {
-        kill(9, $i3_pid)
+        kill(-9, $i3_pid)
             or $tester->BAIL_OUT("could not kill i3");
 
         waitpid $i3_pid, 0;
@@ -138,8 +138,9 @@ sub import {
     my $pkg = caller;
 
     $i3_autostart = delete($args{i3_autostart}) // 1;
+    my $i3_config = delete($args{i3_config}) // '-default';
 
-    my $cv = launch_with_config('-default', dont_block => 1)
+    my $cv = launch_with_config($i3_config, dont_block => 1)
         if $i3_autostart;
 
     my $test_more_args = '';
index b337de9a1db1a25db443dbbbdb71177e72d8ced7..eefdac9ff8884f49fa7e1c5087a0e0cb53965aaa 100644 (file)
 # the time of launching the new one. Also make sure that focusing containers
 # in other workspaces work even when there is a fullscreen container.
 #
-use i3test i3_autostart => 0;
-
-# Screen setup looks like this:
-# +----+----+
-# | S1 | S2 |
-# +----+----+
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 fake-outputs 1024x768+0+0,1024x768+1024+0
 EOT
-
-my $pid = launch_with_config($config);
-
-my $i3 = i3(get_socket_path());
+# Screen setup looks like this:
+# +----+----+
+# | S1 | S2 |
+# +----+----+
 
 my $tmp = fresh_workspace;
 
@@ -331,6 +325,4 @@ verify_move(2, 'prevented move to workspace by position');
 
 # TODO: Tests for "move to output" and "move workspace to output".
 
-exit_gracefully($pid);
-
 done_testing;
index 7562ad90e8f82ed1c0cc27b6d25f339fec0c9785..5f58ca09e4a9ce6c6ea1c3a9912b105c9666597f 100644 (file)
 # Wrong behaviour manifested itself up to (including) commit
 # f78caf8c5815ae7a66de9e4b734546fd740cc19d
 #
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 assign [title="testcase"] targetws
 EOT
 
-my $pid = launch_with_config($config);
-
 my $i3 = i3(get_socket_path(0));
 
 cmd 'workspace targetws';
@@ -51,6 +47,4 @@ cmd 'focus parent';
 open_window(name => "testcase");
 is_num_children('targetws', 3, 'new window opened next to last one');
 
-exit_gracefully($pid);
-
 done_testing;
index 43f7b1783f80b977e86ba92e6909030177cbaa6e..62675b4477a7b8c4e6eeb9090698f42159894dab 100644 (file)
@@ -15,9 +15,7 @@
 #   (unless you are already familiar with Perl)
 #
 # Verifies that the IPC 'mode' event is sent when modes are changed.
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -30,8 +28,6 @@ mode "with spaces" {
 }
 EOT
 
-my $pid = launch_with_config($config);
-
 my $i3 = i3(get_socket_path(0));
 $i3->connect->recv;
 
@@ -52,6 +48,4 @@ $t = AnyEvent->timer(after => 0.5, cb => sub { $cv->send(0); });
 
 ok($cv->recv, 'Mode event received');
 
-exit_gracefully($pid);
-
 done_testing;
index b6ebc876a14c9020a154f828e0646c6c11a09869..bd0b407894c38c8fd26af8cfe63c55abaa9fdbc3 100644 (file)
 #
 
 use List::Util qw(first);
-use i3test i3_autostart => 0;
-use Time::HiRes qw(sleep);
-
-# Ensure the pointer is at (0, 0) so that we really start on the first
-# (the left) workspace.
-$x->root->warp_pointer(0, 0);
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 force_display_urgency_hint 500ms
 EOT
-my $pid = launch_with_config($config);
+use Time::HiRes qw(sleep);
 
 #####################################################################
 # Initial setup: one window on ws1, empty ws2
@@ -145,6 +138,4 @@ sync_with_i3;
 sleep(0.6);
 is(count_total_urgent(get_ws($tmp3)), 0, "no more urgent windows on workspace $tmp3");
 
-exit_gracefully($pid);
-
 done_testing;
index b6c6d7767a000b1fab353c58ff85d5169a1e5b25..695234c9b5217bb0a3c0e0731626167bff5d56da 100644 (file)
@@ -14,7 +14,7 @@
 # â€¢ http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
 #   (unless you are already familiar with Perl)
 #
-use i3test i3_autostart => 0;
+use i3test;
 use IPC::Run qw(run);
 use File::Temp;
 
@@ -22,14 +22,8 @@ use File::Temp;
 # 1: test that shared memory logging does not work yet
 ################################################################################
 
-my $config = <<EOT;
-# i3 config file (v4)
-font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
-EOT
-
-# NB: launch_with_config sets --shmlog-size=0 because the logfile gets
-# redirected via stdout redirection anyways.
-my $pid = launch_with_config($config);
+# NB: launch_with_config (called in i3test) sets --shmlog-size=0 because the
+# logfile gets redirected via stdout redirection anyways.
 
 my $stdout;
 my $stderr;
@@ -82,6 +76,4 @@ run [ 'i3-dump-log' ],
 like($stderr, qr#^i3-dump-log: ERROR: i3 is running, but SHM logging is not enabled\.#,
     'shm logging not enabled');
 
-exit_gracefully($pid);
-
 done_testing;
index a13e0ad36695f758ef1f21ac8198e83dfab4a401..0a9c39ab5512284ea1b3cf4899bbcda92987a4b1 100644 (file)
@@ -18,9 +18,7 @@
 # criteria for windows on non-visible workspaces.
 # Ticket: #1027
 # Bug still in: 4.5.1-90-g6582da9
-use i3test i3_autostart => 0;
-
-my $config = <<'EOT';
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -28,8 +26,6 @@ assign [class="^special$"] â†’ mail
 for_window [class="^special$"] floating enable, floating disable
 EOT
 
-my $pid = launch_with_config($config);
-
 my $window = open_window(
     name => 'Borderless window',
     wm_class => 'special',
@@ -43,6 +39,4 @@ cmd '[class="^special$"] focus';
 
 does_i3_live;
 
-exit_gracefully($pid);
-
 done_testing;
index 57d8b434d116c41e96953379703beb992f7977a7..1e1df7beaddc771129158e625fcc3668203459e7 100644 (file)
 #
 # Ticket: #1086
 # Bug still in: 4.6-62-g7098ef6
-use i3test i3_autostart => 0;
+use i3test i3_config => <<EOT;
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+
+assign [class="special"] nonvisible
+EOT
 
 sub open_special {
     my %args = @_;
@@ -38,14 +43,6 @@ sub open_special {
     return $window;
 }
 
-my $config = <<EOT;
-# i3 config file (v4)
-font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
-
-assign [class="special"] nonvisible
-EOT
-my $pid = launch_with_config($config);
-
 my $tmp = fresh_workspace;
 
 ok((scalar grep { $_ eq 'nonvisible' } @{get_workspace_names()}) == 0,
@@ -60,6 +57,4 @@ ok((scalar grep { $_ eq 'nonvisible' } @{get_workspace_names()}) > 0,
 my @urgent = grep { $_->{urgent} } @{get_ws_content('nonvisible')};
 isnt(@urgent, 0, 'urgent window(s) found on destination workspace');
 
-exit_gracefully($pid);
-
 done_testing;
index b9f9a79799d39033a81960750e762bca66dd7d60..bfd7aa4bd92e7a06024fb69ca1f36eae0c06fd89 100644 (file)
 # client.
 # Ticket: #1201
 # Bug still in: 4.7.2-107-g9b03be6
-use i3test i3_autostart => 0;
-
-my $config = <<'EOT';
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 EOT
 
-my $pid = launch_with_config($config);
-
-my $i3 = i3(get_socket_path());
-$i3->connect()->recv;
-
 my $window = open_window(
     wm_class => 'special',
     window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK'),
@@ -39,6 +32,4 @@ cmd('[class="special"] resize grow height 160 px or 16 ppt');
 
 does_i3_live;
 
-exit_gracefully($pid);
-
 done_testing;
index e4d51e2eb6c52db46be355761fc26770eee37fa5..9d1ac70c4a72eb673af30f811ae1c83927a105ae 100644 (file)
 # and that they keep their geometry.
 # Ticket: #1263
 # Bug still in: 4.7.2-200-g570b572
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 for_window [instance=__i3-test-window] floating enable, border pixel 1
 EOT
 
-my $pid = launch_with_config($config);
 my $tmp = fresh_workspace;
 
 my $window = open_window(wm_class => '__i3-test-window');
@@ -46,6 +43,4 @@ $floating_win = $nodes->{floating_nodes}->[0]->{nodes}->[0];
 is($floating_win->{fullscreen_mode}, 1, 'floating window still in fullscreen mode');
 is_deeply($floating_win->{geometry}, $old_geometry, 'floating window geometry still the same');
 
-exit_gracefully($pid);
-
 done_testing;
index 1b78f253af4ce69313f8b63cee42bef541f5857b..3f47970cd255dedad5949670b355b3eea8ef5222 100644 (file)
@@ -19,9 +19,7 @@
 # which can lead to complications
 # Ticket: #1283
 # Bug still in: 4.8-24-g60070de
-use i3test i3_autostart => 0;
-
-my $config = <<'EOT';
+use i3test i3_config => <<'EOT';
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -29,8 +27,6 @@ for_window [class="^special_kill$"] kill
 for_window [class="^special_scratchpad$"] move scratchpad
 EOT
 
-my $pid = launch_with_config($config);
-
 my $win = open_window;
 
 my $scratch_window = open_window(
@@ -53,6 +49,4 @@ sync_with_i3;
 is($x->input_focus, $win->{id},
     'an assignment that kills a window should not disturb focus');
 
-exit_gracefully($pid);
-
 done_testing;
index e9cb537ebc05b32016c830ec183d6d8794afdb37..e193c02178193db8818b5676d1fe5a767cbf6c9e 100644 (file)
@@ -18,9 +18,7 @@
 # assigned to an invisible workspace) will not crash i3.
 # Ticket: #1338
 # Bug still in: 4.8-91-g294d52e
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -28,8 +26,6 @@ assign [title=".*"] 1
 for_window [title=".*"] layout tabbed, focus
 EOT
 
-my $pid = launch_with_config($config);
-
 # Switch away from workspace 1
 my $tmp = fresh_workspace;
 
@@ -37,6 +33,4 @@ my $win = open_window;
 
 does_i3_live;
 
-exit_gracefully($pid);
-
 done_testing;
index 283d173180904e7cf0a222a57eca9e66d966a910..3fcd24167b02b4bdf182d66b2862eac8b68f23d5 100644 (file)
@@ -18,9 +18,7 @@
 # Decorations are disabled to avoid floating_enable's logic which shifts
 # windows upwards dependent on their decoration height.
 #
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -28,8 +26,6 @@ new_window none
 new_float none
 EOT
 
-my $pid = launch_with_config($config);
-
 #####################################################################
 # Open a floating window, verifying that its initial position is
 # centered, and also verify that both centering methods leave it in
@@ -101,6 +97,4 @@ my $child = $fourth->rect;
 is($new->{x}, $child->{x}, 'x coordinates match');
 is($new->{y}, $child->{y}, 'y coordinates match');
 
-exit_gracefully($pid);
-
 done_testing;
index dbc9a80ae82e431f7ee74fca31cb29b87304bcc5..b1c7fca03e6005ea8b39bae62706139aac029e76 100644 (file)
@@ -17,9 +17,7 @@
 # Ensures that 'move workspace $new, floating enable' on a marked window
 # leaves the window centered on the new workspace.
 # Bug still in: 4.10.2-137-ga4f0ed6
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -27,8 +25,6 @@ new_window none
 new_float none
 EOT
 
-my $pid = launch_with_config($config);
-
 #####################################################################
 # Open a tiled window, and then simultaneously move it to another
 # workspace and float it, ensuring that it ends up centered.
@@ -48,6 +44,4 @@ is(int($pos->{x} + $pos->{width} / 2), int($x->root->rect->width / 2),
 is(int($pos->{y} + $pos->{height} / 2), int($x->root->rect->height / 2),
     'y coordinates match');
 
-exit_gracefully($pid);
-
 done_testing;
index 10ef3774833036436e422bbe865495a2168ecf7a..314a85114be0bf41b4852fd377d31dc6080919c9 100644 (file)
 # to focus_on_window_activation=urgent), hence the application not clearing it.
 # Ticket: #1825
 # Bug still in: 4.10.3-253-g03799dd
-use i3test i3_autostart => 0;
+use i3test i3_config => <<EOT;
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+
+focus_on_window_activation urgent
+EOT
 
 sub send_net_active_window {
     my ($id) = @_;
@@ -35,15 +40,6 @@ sub send_net_active_window {
     $x->send_event(0, $x->get_root_window(), X11::XCB::EVENT_MASK_SUBSTRUCTURE_REDIRECT, $msg);
 }
 
-my $config = <<'EOT';
-# i3 config file (v4)
-font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
-
-focus_on_window_activation urgent
-EOT
-
-my $pid = launch_with_config($config);
-my $i3 = i3(get_socket_path(0));
 my $ws = fresh_workspace;
 my $first = open_window;
 my $second = open_window;
@@ -64,6 +60,4 @@ cmd '[urgent=latest] focus';
 sync_with_i3;
 is($x->input_focus, $second->id, 'second window still focused');
 
-exit_gracefully($pid);
-
 done_testing;
index b27ded3ef527b96b5329ced6a596c1f234a8485d..7d8229dd19870f2832faead7eee023af2c41a1dd 100644 (file)
 # Verifies that "move container to output" works correctly when
 # used with command criteria.
 # Bug still in: 4.10.4-349-gee5db87
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 fake-outputs 800x600+0+0,800x600+800+0,800x600+0+600,800x600+800+600
 EOT
 
-my $pid = launch_with_config($config);
-
 my $ws_top_left = fresh_workspace(output => 0);
 my $ws_top_right = fresh_workspace(output => 1);
 my $ws_bottom_left = fresh_workspace(output => 2);
@@ -45,6 +41,4 @@ is_num_children($ws_top_right, 1, 'one container on the upper right workspace');
 is_num_children($ws_bottom_left, 0, 'no containers on the lower left workspace');
 is_num_children($ws_bottom_right, 1, 'one container on the lower right workspace');
 
-exit_gracefully($pid);
-
 done_testing;
index 843b8fe685af15834613dd6ebb56d8b448274397..1c19cb7850892a3cf252710cd6f49df0e2064569 100644 (file)
 # Ticket: #2062
 # Bug still in: 4.11-103-gc8d51b4
 # Bug introduced with commit 0e5180cae9e9295678e3f053042b559e82cb8c98
-use i3test i3_autostart => 0;
+use i3test
+    i3_config => <<EOT;
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+
+bindsym Print nop Print
+bindsym Mod4+Return nop Mod4+Return
+EOT
 use i3test::XTEST;
 use ExtUtils::PkgConfig;
 
@@ -29,16 +36,6 @@ SKIP: {
     skip "setxkbmap not found", 1 if
         system(q|setxkbmap -print >/dev/null|) != 0;
 
-my $config = <<EOT;
-# i3 config file (v4)
-font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
-
-bindsym Print nop Print
-bindsym Mod4+Return nop Mod4+Return
-EOT
-
-my $pid = launch_with_config($config);
-
 start_binding_capture;
 
 system(q|setxkbmap us,ru -option grp:alt_shift_toggle|);
@@ -92,8 +89,6 @@ is(scalar @i3test::XTEST::binding_events, 4, 'Received exactly 4 binding events'
 # Disable the grp:alt_shift_toggle option, as we use Alt+Shift in other testcases.
 system(q|setxkbmap us -option|);
 
-exit_gracefully($pid);
-
 }
 
 done_testing;
index b0d778587823df9dae1ec877e8060c8921e2fc77..efacdb5206f3f96c92eb4668d4ac261aaa7a3610 100644 (file)
 # Ticket: #2002
 # Bug still in: 4.11-103-gc8d51b4
 # Bug introduced with commit bf3cd41b5ddf1e757515ab5fbf811be56e5f69cc
-use i3test i3_autostart => 0;
-use i3test::XTEST;
-use ExtUtils::PkgConfig;
-
-SKIP: {
-    skip "libxcb-xkb too old (need >= 1.11)", 1 unless
-        ExtUtils::PkgConfig->atleast_version('xcb-xkb', '1.11');
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -38,8 +30,12 @@ bindsym --release Control+Print nop Control+Print
 bindsym Mod1+b nop Mod1+b
 bindsym --release Mod1+Shift+b nop Mod1+Shift+b release
 EOT
+use i3test::XTEST;
+use ExtUtils::PkgConfig;
 
-my $pid = launch_with_config($config);
+SKIP: {
+    skip "libxcb-xkb too old (need >= 1.11)", 1 unless
+        ExtUtils::PkgConfig->atleast_version('xcb-xkb', '1.11');
 
 start_binding_capture;
 
@@ -90,8 +86,6 @@ is(listen_for_binding(
 sync_with_i3;
 is(scalar @i3test::XTEST::binding_events, 4, 'Received exactly 4 binding events');
 
-exit_gracefully($pid);
-
 }
 
 done_testing;
index d72d3d94d5732f260be076c51c781d3efae8f92d..549a862bc915b4e743357eba72c4196dbc84a8b5 100644 (file)
@@ -18,9 +18,7 @@
 # binding mode.
 # Ticket: #2228
 # Bug still in: 4.11-262-geb631ce
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -28,8 +26,6 @@ mode "othermode" {
 }
 EOT
 
-my $pid = launch_with_config($config);
-
 cmd 'mode othermode';
 
 my $i3 = i3(get_socket_path(0));
@@ -51,6 +47,4 @@ $t = AnyEvent->timer(after => 0.5, cb => sub { $cv->send(0); });
 
 ok($cv->recv, 'Mode event received');
 
-exit_gracefully($pid);
-
 done_testing;
index cbbdeb0f66edb13071c4cd21af3cd8d248f12a65..d4b3b689565ee2caa39d0f65c90dba815c540f99 100644 (file)
 #
 # Verifies that command or config criteria does not match dock clients
 # Bug still in: 4.12-38-ge690e3d
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 for_window [class="dock"] move workspace current
 EOT
 
-my $pid = launch_with_config($config);
-
 my $ws = fresh_workspace();
 
 
@@ -67,5 +63,4 @@ is(get_dock_clients, 2, "created second docked client");
 is_num_children($ws, 0, 'no container on the current workspace');
 
 
-exit_gracefully($pid);
 done_testing;
index 760ac53ea0c987384719488de75c23f076a81bd4..d480a85e7c932b94c5216566e60547a23603e5ce 100644 (file)
 # â€¢ http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
 #   (unless you are already familiar with Perl)
 #
-use i3test i3_autostart => 0;
-use X11::XCB qw(PROP_MODE_REPLACE);
-
-##############################################################
-# 13: check that the tiling / floating criteria work.
-##############################################################
-
-my $config = <<"EOT";
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 for_window [tiling] mark tiled
 for_window [floating] mark floated
 EOT
+use X11::XCB qw(PROP_MODE_REPLACE);
+
+##############################################################
+# 13: check that the tiling / floating criteria work.
+##############################################################
 
-my $pid = launch_with_config($config);
 my $tmp = fresh_workspace;
 
 open_window;
@@ -42,8 +39,6 @@ is_deeply($nodes[0]->{marks}, [ 'tiled' ], "mark set for 'tiling' criterion");
 cmp_ok(@nodes, '==', 1, 'one floating container on this workspace');
 is_deeply($nodes[0]->{nodes}[0]->{marks}, [ 'floated' ], "mark set for 'floating' criterion");
 
-exit_gracefully($pid);
-
 ##############################################################
 
 done_testing;
index b010963b1231cc391535e561d2df37d421235669..6b0aad0cb4e8519e8462d871876d5c22ac4799d7 100644 (file)
 # Regression: Checks if focus is stolen when a window is managed which is
 # assigned to an invisible workspace
 #
-use i3test i3_autostart => 0;
+use i3test i3_config => <<EOT;
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+assign [class="special"] targetws
+EOT
 
 sub open_special {
     my %args = @_;
@@ -38,14 +42,6 @@ sub open_special {
 # start a window and see that it does not get assigned with an empty config
 #####################################################################
 
-my $config = <<EOT;
-# i3 config file (v4)
-font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
-assign [class="special"] targetws
-EOT
-
-my $pid = launch_with_config($config);
-
 my $tmp = fresh_workspace;
 
 ok(@{get_ws_content($tmp)} == 0, 'no containers yet');
@@ -70,8 +66,6 @@ ok(@{get_ws_content($tmp)} == 0, 'special window not on current workspace');
 ok(@{get_ws_content('targetws')} == 1, 'special window on targetws');
 ok(get_ws($tmp)->{focused}, 'current workspace still focused');
 
-exit_gracefully($pid);
-
 $window->destroy;
 
 done_testing;
index d5994f5839fc01449dd3a81f67d30519c7ead078..5563ec328a3004bc1cb20a888c70e727dbbc835a 100644 (file)
@@ -18,9 +18,7 @@
 # not applied when the default tiling border is set to a pixel value.
 # Ticket: #1305
 # Bug still in: 4.8-62-g7381b50
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -28,8 +26,6 @@ new_window pixel 5
 new_float normal
 EOT
 
-my $pid = launch_with_config($config);
-
 my $ws = fresh_workspace;
 
 my $float_window = open_floating_window;
@@ -38,6 +34,4 @@ my @floating = @{get_ws($ws)->{floating_nodes}};
 
 is($floating[0]->{nodes}[0]->{border}, 'normal', 'default floating border is `normal`');
 
-exit_gracefully($pid);
-
 done_testing;
index ce237b57b707171e0b83ac332ab81714e6ecc6c5..38b8351d7f249d27822c96859e0ed6122b3b9a89 100644 (file)
 # in criteria selection
 # Ticket: #1052
 # Bug still in: 4.8-73-g6bf7f8e
-use i3test i3_autostart => 0;
-use X11::XCB qw(PROP_MODE_REPLACE);
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 for_window [class="Special"] mark special_class_mark
 EOT
-
-my $pid = launch_with_config($config);
+use X11::XCB qw(PROP_MODE_REPLACE);
 
 sub change_window_class {
     my ($window, $class, $length) = @_;
@@ -73,6 +69,4 @@ $con = @{get_ws_content($ws)}[0];
 is($con->{window_properties}->{class}, 'a',
     'Non-null-terminated strings should be handled correctly');
 
-exit_gracefully($pid);
-
 done_testing;
index 6d5d12c3d5fd720b1f04771cee51e22b5837a4ae..ad81244e02cfc971d7faa3b2ccd5078b99da896b 100644 (file)
@@ -16,9 +16,7 @@
 #
 # Test that the binding event works properly
 # Ticket: #1210
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -30,16 +28,9 @@ SKIP: {
 
     skip 'xdotool is required to test the binding event. `[apt-get install|pacman -S] xdotool`', 1 if $?;
 
-    my $pid = launch_with_config($config);
-
-    my $i3 = i3(get_socket_path());
-    $i3->connect->recv;
-
     qx(xdotool key r);
 
     does_i3_live;
 
-    exit_gracefully($pid);
-
 }
 done_testing;
index 7947158c6a7bae2d76757d756a1c06301bbe72c7..b4f1a4c2e71166345b47d6f6ad386c4de14d8cac 100644 (file)
 # unfocused window within a tabbed container.
 # Ticket: #1484
 # Bug still in: 4.9.1-124-g856e1f9
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 workspace_layout tabbed
 EOT
 
-my $pid = launch_with_config($config);
-
 open_window;
 open_window;
 
@@ -39,6 +35,4 @@ cmd '[con_mark=foo] floating enable, floating disable';
 
 does_i3_live;
 
-exit_gracefully($pid);
-
 done_testing;
index c8fd89efd21ea41dbcb2c2ead99e2bc8993b46e1..3500477022d32ba647b03d6c26f125872371e26a 100644 (file)
 # Verifies that mouse bindings work on the root window if
 # --whole-window is set.
 # Ticket: #2115
-use i3test i3_autostart => 0;
-use i3test::XTEST;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 workspace_auto_back_and_forth no
 bindsym --whole-window button4 workspace special
 EOT
+use i3test::XTEST;
 
-my $pid = launch_with_config($config);
 fresh_workspace;
 
 xtest_button_press(4, 50, 50);
@@ -37,6 +34,4 @@ sync_with_i3;
 
 is(focused_ws(), 'special', 'the binding was triggered');
 
-exit_gracefully($pid);
-
 done_testing;
index 3ba8f51ba151ee3d78d2fcc606bc186a584cf74c..7b7ad8aeb2f6c623f715b42eadf49bc207ea98d1 100644 (file)
@@ -16,9 +16,7 @@
 #
 # Tests the swap command.
 # Ticket: #917
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -26,14 +24,11 @@ for_window[class="mark_A"] mark A
 for_window[class="mark_B"] mark B
 EOT
 
-my ($pid);
 my ($ws, $ws1, $ws2, $ws3);
 my ($nodes, $expected_focus, $A, $B, $F);
 my ($result);
 my @urgent;
 
-$pid = launch_with_config($config);
-
 ###############################################################################
 # Invalid con_id should not crash i3
 # See issue #2895.
@@ -425,6 +420,4 @@ kill_all_windows;
 
 ###############################################################################
 
-exit_gracefully($pid);
-
 done_testing;
index 3df2ba3f779303015731028bed1141d5a367bc29..6b62df3cab4f3d49e66c640ad2185b2e6e5cd20c 100644 (file)
 # Tests that the provided X-Server to the t/5??-*.t tests is actually providing
 # multiple monitors.
 #
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 fake-outputs 1024x768+0+0,1024x768+1024+0
 EOT
-my $pid = launch_with_config($config);
 
 my $i3 = i3(get_socket_path());
 
@@ -39,6 +36,5 @@ my @outputs = map { $_->{name} } @{$tree->{nodes}};
 is_deeply(\@outputs, [ '__i3', 'fake-0', 'fake-1' ],
           'multi-monitor outputs ok');
 
-exit_gracefully($pid);
 
 done_testing;
index 0f9b0df012730f31f8293207c652a89068934e80..5aad2504fad80ff6e166b4ff56dbbe8d67abdf88 100644 (file)
 # ticket #596, bug present until up to commit
 # 89dded044b4fffe78f9d70778748fabb7ac533e9.
 #
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 fake-outputs 1024x768+0+0,1024x768+1024+0
 EOT
-my $pid = launch_with_config($config);
-
-my $i3 = i3(get_socket_path());
 
 ################################################################################
 # Open a workspace on the second output, put a window to scratchpad, display
@@ -113,6 +108,4 @@ $second = fresh_workspace(output => 0);
 
 verify_scratchpad_switch($first, $second);
 
-exit_gracefully($pid);
-
 done_testing;
index cf297f0e2e72ee6ed8df94816deb3664de75156b..4b6fac401b03e290f619369d7175fb1547eb22dc 100644 (file)
 #
 # Verifies the 'focus output' command works properly.
 
-use i3test i3_autostart => 0;
-use List::Util qw(first);
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 fake-outputs 1024x768+0+0,1024x768+1024+0
 EOT
-my $pid = launch_with_config($config);
+use List::Util qw(first);
 
 my $tmp = fresh_workspace;
 my $i3 = i3(get_socket_path());
@@ -89,6 +86,4 @@ is(focused_output, 'fake-1', 'focus on second output');
 cmd 'focus output fake-0';
 is(focused_output, 'fake-0', 'focus on first output');
 
-exit_gracefully($pid);
-
 done_testing;
index 7fe7f15b237953c7c6af3149260973bb3895af1b..62f15394343d8adbdc47f74ea21d360e14c2386b 100644 (file)
 # Tests whether 'workspace next_on_output' and the like work correctly.
 #
 use List::Util qw(first);
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 fake-outputs 1024x768+0+0,1024x768+1024+0
 EOT
-my $pid = launch_with_config($config);
 
 ################################################################################
 # Setup workspaces so that they stay open (with an empty container).
@@ -100,6 +97,4 @@ sync_with_i3;
 cmd 'workspace prev_on_output';
 is(focused_ws, '2', 'workspace 2 focused');
 
-exit_gracefully($pid);
-
 done_testing;
index c43b8b407a39523336e0cacbb821e4508e699b75..b62dc21943a52aa2f38d31e3665ecfc4ca62b7e5 100644 (file)
 # Tests whether the 'move workspace <ws> to [output] <output>' command works
 #
 use List::Util qw(first);
-use i3test i3_autostart => 0;
-
-# Ensure the pointer is at (0, 0) so that we really start on the first
-# (the left) workspace.
-$x->root->warp_pointer(0, 0);
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 fake-outputs 1024x768+0+0,1024x768+1024+0
 EOT
-my $pid = launch_with_config($config);
+
+# TODO: get rid of smartmatch in this test
 
 ################################################################################
 # Setup workspaces so that they stay open (with an empty container).
@@ -181,5 +176,4 @@ ok($ws1 ~~ @$x0, 'ws1 on fake-0');
 
 ################################################################################
 
-exit_gracefully($pid);
 done_testing;
index 2235e802fec5354c7e61d335ae8da188190d6c10..e2dff9dbff84957269caddb801b0ef827b466ec1 100644 (file)
 # Verifies that scratchpad windows don’t move due to floating point caulcation
 # errors when repeatedly hiding/showing, no matter what display resolution.
 #
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 fake-outputs 683x768+0+0,1024x768+683+0
 EOT
-my $pid = launch_with_config($config);
-
-my $i3 = i3(get_socket_path());
 
 sync_with_i3;
 $x->root->warp_pointer(0, 0);
@@ -84,6 +79,4 @@ sync_with_i3;
 my $third = fresh_workspace(output => 1);
 verify_scratchpad_doesnt_move($third);
 
-exit_gracefully($pid);
-
 done_testing;
index 9e80553b2587bd83f51d06bc537df33c06148afd..ed5a90052d7bb63b46779efb306577715a67f6d5 100644 (file)
 # Bug still in: 4.3-78-g66b389c
 #
 use List::Util qw(first);
-use i3test i3_autostart => 0;
-
-# Ensure the pointer is at (0, 0) so that we really start on the first
-# (the left) workspace.
-$x->root->warp_pointer(0, 0);
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 fake-outputs 1024x768+0+0,1024x768+1024+0
 EOT
-my $pid = launch_with_config($config);
 
 ################################################################################
 # Setup workspaces so that they stay open (with an empty container).
@@ -43,6 +36,4 @@ cmd 'move workspace to output fake-1';
 
 does_i3_live;
 
-exit_gracefully($pid);
-
 done_testing;
index d5cd3800a2ea80f1ee6493d1d1ce91f80b0eaa28..e8b8cbcd8f37a78b8bda6c52778c8858fa672072 100644 (file)
 # Tests whether workspace_layout is properly set after startup.
 #
 use List::Util qw(first);
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 fake-outputs 1024x768+0+0
 workspace_layout tabbed
 EOT
-my $pid = launch_with_config($config);
 
 ################################################################################
 # Test that workspace_layout is properly set
 ################################################################################
 
-
 is(focused_ws, '1', 'starting on workspace 1');
 my $ws = get_ws(1);
 is($ws->{workspace_layout}, 'tabbed', 'workspace layout is "tabbed"');
 
-
-exit_gracefully($pid);
-
 done_testing;
index afa0ddef77f3a925eecab1aa70b4816f7288468b..8097f73f0fe7f1bd502a9dbce00f21d3ac8253a7 100644 (file)
 # Tests that switching workspaces via 'focus $dir' never leaves a floating
 # window focused.
 #
-use i3test i3_autostart => 0;
-
-# Ensure the pointer is at (0, 0) so that we really start on the first
-# (the left) workspace.
-$x->root->warp_pointer(0, 0);
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 fake-outputs 1024x768+0+0,1024x768+1024+0,1024x768+0+768,1024x768+1024+768
 EOT
-my $pid = launch_with_config($config);
 
 my $s0_ws = fresh_workspace;
 my $first = open_window;
@@ -144,6 +137,4 @@ cmd "workspace $s2_ws";
 cmd 'focus up';
 is($x->input_focus, $second->id, 'second window focused');
 
-exit_gracefully($pid);
-
 done_testing;
index 561d24354d0ec396441e2589f466504a24db2b5b..851afb4afa6d1b790a852529d5934dac7f26b65e 100644 (file)
 # Tests that ConfigureRequests don’t make windows fall out of the scratchpad.
 # Ticket: #898
 # Bug still in: 4.4-15-g770ead6
-use i3test i3_autostart => 0;
-
-# Ensure the pointer is at (0, 0) so that we really start on the first
-# (the left) workspace.
-$x->root->warp_pointer(0, 0);
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 fake-outputs 1024x768+0+0,1024x768+1024+0
 EOT
 
-my $pid = launch_with_config($config);
-
 my $left_ws = fresh_workspace(output => 0);
 my $right_ws = fresh_workspace(output => 1);
 
@@ -49,6 +41,4 @@ is(scalar @{$ws->{floating_nodes}}, 0, 'scratchpad window still in scratchpad af
 $ws = get_ws($right_ws);
 is(scalar @{$ws->{floating_nodes}}, 0, 'scratchpad window still in scratchpad after ConfigureRequest');
 
-exit_gracefully($pid);
-
 done_testing;
index 82d5a7ccf6355fec34a45d57fae0362c44e9cede..2c5a27af98c37af3f7d5735d34715b5e079c0d60 100644 (file)
 # E.g. when you have a container on the right output and you move it to the
 # right, it should appear on the left output.
 # Bug still in: 4.4-106-g3cd4b8c
-use i3test i3_autostart => 0;
-
-# Ensure the pointer is at (0, 0) so that we really start on the first
-# (the left) workspace.
-$x->root->warp_pointer(0, 0);
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 fake-outputs 1024x768+0+0,1024x768+1024+0
 EOT
 
-my $pid = launch_with_config($config);
-
 my $right = fresh_workspace(output => 1);
 my $left = fresh_workspace(output => 0);
 
@@ -51,6 +43,4 @@ cmd 'move container to output right';
 is_num_children($left, 1, 'one container on left workspace');
 is_num_children($right, 0, 'no containers on right workspace');
 
-exit_gracefully($pid);
-
 done_testing;
index 3e27a6c09f070560a26a9902de592ee559f53cb7..fb9f0e256d522ce85256faaf42846cf590e42fce 100644 (file)
 #   (unless you are already familiar with Perl)
 #
 # Tests whether moving workspaces between outputs works correctly.
-use i3test i3_autostart => 0;
-use List::Util qw(first);
-
-# Ensure the pointer is at (0, 0) so that we really start on the first
-# (the left) workspace.
-$x->root->warp_pointer(0, 0);
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 fake-outputs 1024x768+0+0,1024x768+1024+0
 EOT
-
-my $pid = launch_with_config($config);
+use List::Util qw(first);
 
 sub workspaces_per_screen {
     my $i3 = i3(get_socket_path());
@@ -92,6 +84,4 @@ cmd '[id="' . $win1->id . '"] focus';
 ($nodes, $focus) = get_ws_content('5');
 is($nodes->[1]->{window}, $win1->id, 'window 1 on workspace 5 after moving');
 
-exit_gracefully($pid);
-
 done_testing;
index 61622ab080f1b61415ec0b69a36f43b5e79aee1b..f34ee2330ec3de771c43d30664e8f85f80b7a964 100644 (file)
 # Ticket: #990
 # Bug still in: 4.5.1-23-g82b5978
 
-use i3test i3_autostart => 0;
-
-# Ensure the pointer is at (0, 0) so that we really start on the first
-# (the left) workspace.
-$x->root->warp_pointer(0, 0);
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 fake-outputs 1024x768+0+0,1024x768+1024+0
 EOT
 
-my $pid = launch_with_config($config);
-
 my $i3 = i3(get_socket_path());
 
 $i3->connect()->recv;
@@ -73,6 +65,4 @@ ok($event, 'Workspace "focus" event received');
 is($event->{current}->{id}, $current_ws->{id}, 'Event gave correct current workspace');
 is($event->{old}->{id}, $old_ws->{id}, 'Event gave correct old workspace');
 
-exit_gracefully($pid);
-
 done_testing;
index be790bf0ebaa708b7df3e7b40968321b8e4c7e4f..aad0693f04d18ff6109ba26f9490ad3d4ee6d205 100644 (file)
@@ -17,9 +17,7 @@
 # Tests that new workspace names are taken from the config,
 # then from the first free number starting with 1.
 #
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -27,7 +25,6 @@ fake-outputs 1024x768+0+0,1024x768+1024+0
 
 bindsym 1 workspace 1: eggs
 EOT
-my $pid = launch_with_config($config);
 
 my $i3 = i3(get_socket_path());
 my $ws = $i3->get_workspaces->recv;
@@ -35,6 +32,4 @@ my $ws = $i3->get_workspaces->recv;
 is($ws->[0]->{name}, '1: eggs', 'new workspace uses config name');
 is($ws->[1]->{name}, '2', 'naming continues with next free number');
 
-exit_gracefully($pid);
-
 done_testing;
index 0d21ca3140bfe520873a9bab36593797ca291505..3a4fa2ead3cdcfea08b67cced4e45a5ef4473594 100644 (file)
 #
 # Tests if a simple 'move <direction>' command will move containers across outputs.
 #
-use i3test i3_autostart => 0;
-
-# Ensure the pointer is at (0, 0) so that we really start on the first
-# (the left) workspace.
-$x->root->warp_pointer(0, 0);
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -34,7 +28,9 @@ workspace right-bottom output fake-2
 workspace left-bottom output fake-3
 EOT
 
-my $pid = launch_with_config($config);
+# Ensure the pointer is at (0, 0) so that we really start on the first
+# (the left) workspace.
+$x->root->warp_pointer(0, 0);
 
 #####################################################################
 # Try to move a single window across outputs in each direction
@@ -101,6 +97,4 @@ is(scalar @{get_ws_content('left-top')}, 1, 'moved some window to left-bottom wo
 $compare_window = shift @{get_ws_content('left-top')};
 is($social_window->name, $compare_window->{name}, 'moved correct window to left-bottom workspace');
 
-exit_gracefully($pid);
-
 done_testing;
index 383b27796fd381a67c62ab65d8194ef590229cff..1a325ae764b45695686bb5ffbb0fd41033757906 100644 (file)
@@ -18,9 +18,7 @@
 # ipc event required for i3bar to be properly updated and redrawn.
 #
 # Bug still in: 4.6-195-g34232b8
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -29,8 +27,6 @@ workspace ws-left output fake-0
 workspace ws-right output fake-1
 EOT
 
-my $pid = launch_with_config($config);
-
 my $i3 = i3(get_socket_path());
 $i3->connect()->recv;
 
@@ -78,6 +74,4 @@ ok($event, 'moving from workspace with one window triggered focus ipc event');
 is($event->{current}->{name}, 'ws-right', 'focus event gave the right workspace');
 is(@{$event->{current}->{nodes}}, 2, 'focus event gave the right number of windows on the workspace');
 
-exit_gracefully($pid);
-
 done_testing;
index 577881f06e813f91b88bf92c3c5c79b7fe1a1f34..aa2e2a2701b55a5553d149afd3e74b2a959bf251 100644 (file)
@@ -18,9 +18,7 @@
 # assign any workspace of that number to the specified output.
 # Ticket: #1238
 # Bug still in: 4.7.2-147-g3760a48
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -32,7 +30,6 @@ workspace 2:override output fake-1
 fake-outputs 1024x768+0+0,1024x768+1024+0
 EOT
 
-my $pid = launch_with_config($config);
 my $i3 = i3(get_socket_path());
 $i3->connect->recv;
 
@@ -72,6 +69,4 @@ is(get_output_for_workspace('1:override'), 'fake-0',
     'Assignment rules should not be affected by the order assignments are declared')
     or diag 'Since workspace "1:override" is assigned by name to fake-0, it should open on fake-0';
 
-exit_gracefully($pid);
-
 done_testing;
index 674f4cdbc8fcdf8610734dc2eb6d2187f6956c22..5b7e2c179c659c58f7c6a1d334f92b274747a2de 100644 (file)
 # â€¢ http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
 #   (unless you are already familiar with Perl)
 
-use i3test i3_autostart => 0;
-
-# Ensure the pointer is at (0, 0) so that we really start on the first
-# (the left) workspace.
-$x->root->warp_pointer(0, 0);
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 fake-outputs 1024x768+0+0,1024x768+1024+0
 mouse_warping none
 EOT
-my $pid = launch_with_config($config);
 
-my $i3 = i3(get_socket_path());
+# Ensure the pointer is at (0, 0) so that we really start on the first
+# (the left) workspace.
+$x->root->warp_pointer(0, 0);
 
 ######################################################
 # Open one workspace with one window on both outputs #
@@ -47,6 +42,4 @@ $x->root->warp_pointer(0, 0);
 # Ensure focus is still on workspace 2
 is(focused_ws, '2', 'warped mouse cursor to (0, 0), focus still in workspace 2');
 
-# Exit gracefully
-exit_gracefully($pid);
 done_testing;
index ccef49e7e2d3d4806906bd761a1a0a58e6d9edb1..871f80450be581caa7d61460001f998bf8554259 100644 (file)
@@ -17,9 +17,7 @@
 # Ensure that `focus [direction]` will focus an existing floating con when no
 # tiling con exists on the output in [direction] when focusing across outputs
 # Bug still in: 4.7.2-204-g893dbae
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -31,8 +29,6 @@ mouse_warping none
 fake-outputs 1024x768+0+0,1024x768+1024+0
 EOT
 
-my $pid = launch_with_config($config);
-
 cmd 'workspace ws_left';
 my $win = open_window();
 
@@ -43,6 +39,4 @@ cmd 'focus left';
 is($x->input_focus, $win->id,
     'Focusing across outputs with `focus [direction]` should focus an existing floating con when no tiling con exists on the output in [direction].');
 
-exit_gracefully($pid);
-
 done_testing;
index 9e36090ca50d9b8b37c5e21e973ff75c9455dafc..273547693a388b28230663891cdaf07a3e71cdab 100644 (file)
@@ -18,9 +18,7 @@
 # properly on the root window. We interpret this as a list of x/y coordinate
 # pairs for the upper left corner of the respective outputs of the workspaces
 # Ticket: #1241
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -30,8 +28,6 @@ workspace 1 output fake-1
 fake-outputs 1024x768+0+0,1024x768+1024+0
 EOT
 
-my $pid = launch_with_config($config);
-
 sub get_desktop_viewport {
     # Make sure that i3 pushed its changes to X11 before querying.
     sync_with_i3;
@@ -90,6 +86,4 @@ cmd 'workspace 0';
 is_deeply(\@desktop_viewport, \@expected_viewport,
     'it should be updated when a workspace is emptied');
 
-exit_gracefully($pid);
-
 done_testing;
index aa69d66d8c8a5ea92396bb63493e6920757c34d7..a2e8ea5cb2284af2ed3826e7333ed098da7f5f75 100644 (file)
@@ -19,9 +19,7 @@
 # are renamed to an assigned name.
 # Ticket: #1473
 
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 fake-outputs 1024x768+0+0,1024x768+1024+0
@@ -32,7 +30,6 @@ workspace 3:foo output fake-1
 workspace baz output fake-1
 EOT
 
-my $pid = launch_with_config($config);
 my $i3 = i3(get_socket_path());
 $i3->connect->recv;
 
@@ -85,6 +82,4 @@ cmd 'rename workspace to baz';
 is(get_output_for_workspace('baz'), 'fake-1',
     'Renaming the workspace to a number and name should move it to the assigned output');
 
-
-exit_gracefully($pid);
 done_testing;
index 6b58424571b7e9f5454e9f8ced1fc64377e1f363..f0a8a8166547966759087a92249d1aa40306d865 100644 (file)
@@ -18,9 +18,7 @@
 # the appropriate output.
 # Ticket: #1211
 # Bug still in: 4.9.1-108-g037cb31
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -30,8 +28,6 @@ workspace left output fake-0
 workspace right output fake-1
 EOT
 
-my $pid = launch_with_config($config);
-
 #####################################################################
 # Verify that 'move position center' on a floating window does not
 # move it to another output.
@@ -58,6 +54,4 @@ sync_with_i3;
 is(scalar @{get_ws('left')->{floating_nodes}}, 0, 'no floating nodes on left ws');
 is(scalar @{get_ws('right')->{floating_nodes}}, 1, 'one floating node on right ws');
 
-exit_gracefully($pid);
-
 done_testing;
index 473bf235af12c310151f7a84ef66c736ffd69c0f..8cc20bc0d3911ffbca62e390986057e0288aebd6 100644 (file)
@@ -19,9 +19,7 @@
 # Ticket: #1603
 # Bug still in: 4.10.1-40-g0ad097e
 use List::Util qw(first);
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -35,8 +33,6 @@ workspace left-bottom output fake-3
 workspace_layout stacked
 EOT
 
-my $pid = launch_with_config($config);
-
 #####################################################################
 # Create two windows in the upper left workspace and move them
 # clockwise around the workspaces until the end up where they began.
@@ -94,6 +90,4 @@ cmd '[class="first"] move up';
 is_num_children('left-bottom', 0, 'no children on left-bottom');
 is_num_children('left-top', 2, 'two children on left-top');
 
-exit_gracefully($pid);
-
 done_testing;
index 39690291aedd0fbe1d02435c6ef6218ce3cdf94b..d5de2534194a88087190c92f51220ada87abbe12 100644 (file)
 #
 # Ensures that mouse bindings on the i3bar work correctly.
 # Ticket: #1695
-use i3test i3_autostart => 0;
-use i3test::XTEST;
-
-my ($cv, $timer);
-sub reset_test {
-    $cv = AE::cv;
-    $timer = AE::timer(1, 0, sub { $cv->send(0); });
-}
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 focus_follows_mouse no
@@ -41,8 +32,14 @@ bar {
     bindsym button5 focus left
 }
 EOT
+use i3test::XTEST;
+
+my ($cv, $timer);
+sub reset_test {
+    $cv = AE::cv;
+    $timer = AE::timer(1, 0, sub { $cv->send(0); });
+}
 
-my $pid = launch_with_config($config);
 my $i3 = i3(get_socket_path());
 $i3->connect()->recv;
 my $ws = fresh_workspace;
@@ -63,8 +60,32 @@ $i3->subscribe({
         },
     })->recv;
 
-my $con = $cv->recv;
-ok($con, 'i3bar appeared');
+my $con;
+
+sub i3bar_present {
+    my ($nodes) = @_;
+
+    for my $node (@{$nodes}) {
+       my $props = $node->{window_properties};
+       if (defined($props) && $props->{class} eq 'i3bar') {
+           return 1;
+       }
+    }
+
+    return 0 if !@{$nodes};
+
+    my @children = (map { @{$_->{nodes}} } @{$nodes},
+                    map { @{$_->{'floating_nodes'}} } @{$nodes});
+
+    return i3bar_present(\@children);
+}
+
+if (i3bar_present($i3->get_tree->recv->{nodes})) {
+    ok(1, 'i3bar present');
+} else {
+    $con = $cv->recv;
+    ok($con, 'i3bar appeared');
+}
 
 my $left = open_window;
 my $right = open_window;
@@ -108,6 +129,4 @@ $con = $cv->recv;
 is($con->{window}, $left->{id}, 'button 5 moves focus left');
 reset_test;
 
-exit_gracefully($pid);
-
 done_testing;
index 9e3ed3f280875fad876f2d54b85fee86b4ee483e..19887ac101ecaf5bd04aa52cefdf7cde17e66525 100644 (file)
 #
 # Test reconfiguration of dock clients.
 # Ticket: #1883
-use i3test i3_autostart => 0;
+use i3test i3_config => <<EOT;
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+
+fake-outputs 1024x768+0+0,1024x768+1024+0
+EOT
 
-my ($config, $pid, $window, $rect);
+my ($window, $rect);
 my (@docks);
 
 ###############################################################################
@@ -27,14 +32,6 @@ my (@docks);
 #    moved to the correct position.
 ###############################################################################
 
-$config = <<EOT;
-# i3 config file (v4)
-font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
-
-fake-outputs 1024x768+0+0,1024x768+1024+0
-EOT
-$pid = launch_with_config($config);
-
 $window = open_window({
         window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK')
     });
@@ -50,8 +47,6 @@ is(@docks, 1, 'there is still exactly one dock');
 
 is($docks[0]->{rect}->{x}, 1024, 'dock client has moved to the other screen');
 
-exit_gracefully($pid);
-
 ###############################################################################
 
 done_testing;
index 00a9bbe4e77b498ceb3622835063ed626ef3694c..b10addecf67858e568ca16d7c1d58b7dbe04813a 100644 (file)
 # Tests whether 'workspace next' works correctly.
 #
 use List::Util qw(first);
-use i3test i3_autostart => 0;
+use i3test i3_config => <<EOT;
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+
+fake-outputs 1024x768+0+0,1024x768+1024+0
+EOT
 
 sub assert_next {
     my ($expected) = @_;
@@ -43,14 +48,6 @@ sub assert_prev {
     is(focused_ws, $expected, "workspace $expected focused");
 }
 
-my $config = <<EOT;
-# i3 config file (v4)
-font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
-
-fake-outputs 1024x768+0+0,1024x768+1024+0
-EOT
-my $pid = launch_with_config($config);
-
 sync_with_i3;
 $x->root->warp_pointer(0, 0);
 sync_with_i3;
@@ -124,6 +121,4 @@ assert_prev('2');
 assert_prev('1');
 
 
-exit_gracefully($pid);
-
 done_testing;
index 5f85805194d7fd0baca94b93fe860e9472a46eb1..63c0b6a6d14f022c8bc4545e7384d5b68da02dc7 100644 (file)
 #
 # Tests for _NET_WM_DESKTOP.
 # Ticket: #2153
-use i3test i3_autostart => 0;
+use i3test i3_config => <<EOT;
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+
+bar {
+    status_command i3status
+}
+EOT
 use X11::XCB qw(:all);
 
 ###############################################################################
@@ -78,19 +85,6 @@ sub open_window_with_net_wm_desktop {
     return $window;
 }
 
-###############################################################################
-
-my $config = <<EOT;
-# i3 config file (v4)
-font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
-
-bar {
-    status_command i3status
-}
-EOT
-
-my $pid = launch_with_config($config);
-
 ###############################################################################
 # Upon managing a window which does not set _NET_WM_DESKTOP, the property is
 # set on the window.
@@ -296,6 +290,4 @@ kill_all_windows;
 
 ###############################################################################
 
-exit_gracefully($pid);
-
 done_testing;
index cfe61dec693d4fe4b9a4a4d8bd1b0f0055aff7f2..b975fadad452f4fd13d7fa67eccf411d541e3ec4 100644 (file)
@@ -16,9 +16,7 @@
 #
 # Ticket: #2229
 # Bug still in: 4.11-262-geb631ce
-use i3test i3_autostart => 0;
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -26,7 +24,6 @@ fake-outputs 400x400+0+0,400x400+400+0
 workspace_auto_back_and_forth no
 EOT
 
-my $pid = launch_with_config($config);
 my $i3 = i3(get_socket_path());
 
 # Set it up such that workspace 3 is on the left output and
@@ -43,8 +40,7 @@ cmd 'move workspace to output left';
 # ensure that workspace 3 has now vanished
 my $get_ws = $i3->get_workspaces->recv;
 my @ws_names = map { $_->{name} } @$get_ws;
+# TODO get rid of smartmatch
 ok(!('3' ~~ @ws_names), 'workspace 3 has been closed');
 
-exit_gracefully($pid);
-
 done_testing;
index fd32865339b67f100b0a377cb520a623fe1e5b1e..b2040554d8f35cc6edf432173eb88a339283fc58 100644 (file)
 #
 # Tests that fullscreen windows appear on the output indicated by
 # their geometry
-use i3test i3_autostart => 0;
-use List::Util qw(first);
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
 fake-outputs 1024x768+0+0,1024x768+1024+0
 EOT
-
-my $pid = launch_with_config($config);
+use List::Util qw(first);
 
 # Helper functions
 sub fullscreen($) {
@@ -70,6 +66,4 @@ my $node2 = find_window($tree->{nodes}, $win_on_second_output->{id});
 is($node1->{fullscreen_mode}, 1, "first window is fullscreen");
 is($node2->{fullscreen_mode}, 1, "second window is fullscreen");
 
-exit_gracefully($pid);
-
 done_testing;
index 8f84f9ae959b2e87cbbdd22acdd104b1224510e0..997340fa0546817fe671bd20aaa860e9732ae7db 100644 (file)
 # over an unfocused workspace.
 # Ticket: #2681
 # Bug still in: 4.13-210-g80c23afa
-use i3test i3_autostart => 0;
-
-# Ensure the pointer is at (0, 0) so that we really start on the first
-# (the left) workspace.
-$x->root->warp_pointer(0, 0);
-
-my $config = <<EOT;
+use i3test i3_config => <<EOT;
 # i3 config file (v4)
 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
 
@@ -33,8 +27,6 @@ fake-outputs 1024x768+0+0,1024x768+1024+0
 focus_follows_mouse no
 EOT
 
-my $pid = launch_with_config($config);
-
 cmd 'focus output fake-0';
 my $s0_ws = fresh_workspace;
 
@@ -56,6 +48,4 @@ my $reply = $x->query_pointer_reply($cookie->{sequence});
 cmp_ok($reply->{root_x}, '<', 1024, 'pointer still on fake-0');
 cmp_ok($reply->{root_y}, '<', 768, 'pointer still on fake-0');
 
-exit_gracefully($pid);
-
 done_testing;
index 1a83de2344392eff9b796b9435d2aeee8dc6b52d..ac80eab763a82f373428db1fb9dc4702740b29c9 100644 (file)
 # Tests whether 'workspace next' works correctly.
 #
 use List::Util qw(first);
-use i3test i3_autostart => 0;
+use i3test i3_config => <<EOT;
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+
+fake-outputs 1024x768+0+0,1024x768+1024+0
+EOT
 
 sub assert_next {
     my ($expected) = @_;
@@ -43,14 +48,6 @@ sub assert_prev {
     is(focused_ws, $expected, "workspace $expected focused");
 }
 
-my $config = <<EOT;
-# i3 config file (v4)
-font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
-
-fake-outputs 1024x768+0+0,1024x768+1024+0
-EOT
-my $pid = launch_with_config($config);
-
 sync_with_i3;
 $x->root->warp_pointer(0, 0);
 sync_with_i3;
@@ -124,6 +121,4 @@ assert_prev('2');
 assert_prev('1');
 
 
-exit_gracefully($pid);
-
 done_testing;
index 7723894638b2ed58fba4eb81a58ebc684657480f..6346ebb792ea3773dd75a5381ea87ae7ad21a06c 100644 (file)
 #
 # Tests for _NET_WM_DESKTOP.
 # Ticket: #2153
-use i3test i3_autostart => 0;
+use i3test i3_config => <<EOT;
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+
+workspace "0" output "fake-0"
+workspace "1" output "fake-0"
+workspace "2" output "fake-0"
+workspace "10" output "fake-1"
+workspace "11" output "fake-1"
+workspace "12" output "fake-1"
+
+fake-outputs 1024x768+0+0,1024x768+1024+0
+EOT
 use X11::XCB qw(:all);
 
 sub get_net_wm_desktop {
@@ -38,27 +50,11 @@ sub get_net_wm_desktop {
     return unpack("L", $reply->{value});
 }
 
-my $config = <<EOT;
-# i3 config file (v4)
-font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
-
-workspace "0" output "fake-0"
-workspace "1" output "fake-0"
-workspace "2" output "fake-0"
-workspace "10" output "fake-1"
-workspace "11" output "fake-1"
-workspace "12" output "fake-1"
-
-fake-outputs 1024x768+0+0,1024x768+1024+0
-EOT
-
 ###############################################################################
 # _NET_WM_DESKTOP is updated when the window is moved to another workspace
 # on another output.
 ###############################################################################
 
-my $pid = launch_with_config($config);
-
 cmd 'workspace 0';
 open_window;
 cmd 'workspace 10';
@@ -70,6 +66,4 @@ cmd 'move window to workspace 10';
 
 is(get_net_wm_desktop($con), 1, '_NET_WM_DESKTOP is updated when moving the window');
 
-exit_gracefully($pid);
-
 done_testing;