X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=testcases%2Fnew-test;h=e0b2e13f1b0235bb04aea98f0ad6f34452d5d4ac;hb=aa0b1f599f25cfe858ebbc7fa80d459bcdb2ae02;hp=c2546158267fa2b5a49bf75579b936fea7e9dd7a;hpb=fc0e80ee7f94c74a6b9097299870c80f18c8bfe7;p=i3%2Fi3 diff --git a/testcases/new-test b/testcases/new-test index c2546158..e0b2e13f 100755 --- a/testcases/new-test +++ b/testcases/new-test @@ -15,6 +15,16 @@ use File::Basename qw(basename); use Getopt::Long; use v5.10; +my $usage = <<'EOF'; +Script to create a new testcase from a template. + + # Create (and edit) a new test for moving floating windows + ./new-test floating move + + # Create (and edit) a multi-monitor test for moving workspaces + ./new-test -m move workspaces +EOF + my $multi_monitor; my $result = GetOptions( @@ -24,18 +34,23 @@ my $result = GetOptions( my $testname = join(' ', @ARGV); $testname =~ s/ /-/g; +unless (length $testname) { + say $usage; + exit(0); +} + my $header = <<'EOF'; #!perl # vim:ts=4:sw=4:expandtab # # Please read the following documents before working on tests: -# • http://build.i3wm.org/docs/testsuite.html +# • https://build.i3wm.org/docs/testsuite.html # (or docs/testsuite) # -# • http://build.i3wm.org/docs/lib-i3test.html +# • https://build.i3wm.org/docs/lib-i3test.html # (alternatively: perldoc ./testcases/lib/i3test.pm) # -# • http://build.i3wm.org/docs/ipc.html +# • https://build.i3wm.org/docs/ipc.html # (or docs/ipc) # # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf @@ -68,10 +83,6 @@ if ($multi_monitor) { print $fh <<'EOF'; 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 = <