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 # Check whether the -C option works without a display and doesn't
18 # accidentally start the nagbar.
20 use i3test i3_autostart => 0;
21 use File::Temp qw(tempfile);
25 my ($fh, $tmpfile) = tempfile(UNLINK => 1);
27 my $output = qx(DISPLAY= ../i3 -C -c $tmpfile 2>&1);
31 return ($retval >> 8, $output);
34 ################################################################################
35 # 1: test with a bogus configuration file
36 ################################################################################
40 i_am_an_unknown_config option
43 my ($ret, $out) = check_config($cfg);
44 is($ret, 1, "exit code == 1");
45 like($out, qr/ERROR: *CONFIG: *[Ee]xpected.*tokens/, 'bogus config file');
47 ################################################################################
48 # 2: test with a valid configuration file
49 ################################################################################
53 font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
56 my ($ret, $out) = check_config($cfg);
57 is($ret, 0, "exit code == 0");
58 is($out, "", 'valid config file');