2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • http://build.i3wm.org/docs/ipc.html
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 # (unless you are already familiar with Perl)
17 # Makes sure i3 deletes its temporary directory when exiting.
19 # Bug still in: 4.7.2-186-g617afc6
20 use i3test i3_autostart => 0;
25 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
28 # ensure XDG_RUNTIME_DIR is not set
29 delete $ENV{XDG_RUNTIME_DIR};
31 my $pid = launch_with_config($config, dont_add_socket_path => 1, dont_create_temp_dir => 1);
32 my $socketpath = get_socket_path(0);
33 my $tmpdir = dirname($socketpath);
35 ok(-d $tmpdir, "tmpdir $tmpdir exists");
37 # Clear the error logfile. The testsuite runs in an environment where RandR is
38 # not supported, so there always is a message about xinerama in the error
40 my @errorlogfiles = <$tmpdir/errorlog.*>;
41 for my $fn (@errorlogfiles) {
42 open(my $fh, '>', $fn);
46 exit_gracefully($pid);
48 ok(! -d $tmpdir, "tmpdir $tmpdir was cleaned up");
50 diag('contents = ' . Dumper(<$tmpdir/*>));
53 $pid = launch_with_config($config, dont_add_socket_path => 1, dont_create_temp_dir => 1);
54 $socketpath = get_socket_path(0);
55 $tmpdir = dirname($socketpath);
57 ok(-d $tmpdir, "tmpdir $tmpdir exists");
59 # Clear the error logfile. The testsuite runs in an environment where RandR is
60 # not supported, so there always is a message about xinerama in the error
62 @errorlogfiles = <$tmpdir/errorlog.*>;
63 for my $fn (@errorlogfiles) {
64 open(my $fh, '>', $fn);
68 diag('socket path before restarting is ' . $socketpath);
72 # The socket path will be different, and we use that for checking whether i3 has restarted yet.
73 while (get_socket_path(0) eq $socketpath) {
77 my $new_tmpdir = dirname(get_socket_path());
81 # Clear the error logfile. The testsuite runs in an environment where RandR is
82 # not supported, so there always is a message about xinerama in the error
84 @errorlogfiles = <$new_tmpdir/errorlog.*>;
85 for my $fn (@errorlogfiles) {
86 open(my $fh, '>', $fn);
90 exit_gracefully($pid);
92 ok(! -d $tmpdir, "old tmpdir $tmpdir was cleaned up");
94 diag('contents = ' . Dumper(<$tmpdir/*>));
97 ok(! -d $new_tmpdir, "new tmpdir $new_tmpdir was cleaned up");
99 diag('contents = ' . Dumper(<$new_tmpdir/*>));