From: Michael Stapelberg Date: Sun, 10 Sep 2017 09:30:56 +0000 (+0200) Subject: i3test: add kill_all_windows convenience function X-Git-Tag: 4.15~100^2~1 X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3;a=commitdiff_plain;h=94c76d9e3090e3abb8d66811b082d4290f1a3152 i3test: add kill_all_windows convenience function --- diff --git a/testcases/lib/i3test.pm.in b/testcases/lib/i3test.pm.in index 18bebb52..4046e620 100644 --- a/testcases/lib/i3test.pm.in +++ b/testcases/lib/i3test.pm.in @@ -46,6 +46,7 @@ our @EXPORT = qw( wait_for_map wait_for_unmap $x + kill_all_windows ); =head1 NAME @@ -899,6 +900,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