]> git.sur5r.net Git - i3/i3/commitdiff
i3test: add kill_all_windows convenience function
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 10 Sep 2017 09:30:56 +0000 (11:30 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 19 Sep 2017 14:12:38 +0000 (16:12 +0200)
testcases/lib/i3test.pm.in

index ca64edfd8c6062b46272dd3db0b21e6fe21118e3..5e3f8b2d243c3216a0128c0f16a312078835253c 100644 (file)
@@ -46,6 +46,7 @@ our @EXPORT = qw(
     wait_for_map
     wait_for_unmap
     $x
+    kill_all_windows
 );
 
 =head1 NAME
@@ -900,6 +901,17 @@ sub get_i3_log {
     return slurp($logfile);
 }
 
+=head2 kill_all_windows
+
+Kills all windows to clean up between tests.
+
+=cut
+sub kill_all_windows {
+    # Sync in case not all windows are managed by i3 just yet.
+    sync_with_i3;
+    cmd '[title=".*"] kill';
+}
+
 =head1 AUTHOR
 
 Michael Stapelberg <michael@i3wm.org>