From: Michael Stapelberg Date: Thu, 14 Sep 2017 09:30:58 +0000 (+0200) Subject: tests: remove the (broken) exit_gracefully check X-Git-Tag: 4.15~87^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=363417e01067efe2fce43f9bb47a2607c455d0ea;p=i3%2Fi3 tests: remove the (broken) exit_gracefully check I previously tried to fix the check, but could only come up with a fix which required removing our module pre-loading, which makes the tests considerably more expensive. Instead, let’s just remove the check. --- diff --git a/testcases/lib/TestWorker.pm b/testcases/lib/TestWorker.pm index c56767c4..9716f7f1 100644 --- a/testcases/lib/TestWorker.pm +++ b/testcases/lib/TestWorker.pm @@ -47,12 +47,9 @@ sub worker { $worker->{ipc} = $ipc_child; + # Preload the i3test module: reduces user CPU from 25s to 18s require i3test; - # TODO: recycle $x - # unfortunately this fails currently with: - # Could not get reply for: xcb_intern_atom_reply at X11/XCB/Atom.pm line 22. - # $i3test::x = bless $x, 'i3test::X11'; worker_wait($worker, $outdir); exit 23; @@ -86,11 +83,11 @@ sub worker_wait { exit unless $file; - die "tried to launch nonexistend testfile $file: $!\n" + die "tried to launch nonexistent testfile $file: $!\n" unless -e $file; # start a new and self contained process: - # whatever happens in the testfile should *NOT* effect us. + # whatever happens in the testfile should *NOT* affect us. my $pid = fork // die "could not fork: $!"; if ($pid == 0) { diff --git a/testcases/lib/i3test.pm.in b/testcases/lib/i3test.pm.in index a9cfba37..222babcf 100644 --- a/testcases/lib/i3test.pm.in +++ b/testcases/lib/i3test.pm.in @@ -100,14 +100,8 @@ my $i3_pid; my $i3_autostart; END { - - # testcases which start i3 manually should always call exit_gracefully - # on their own. Let’s see, whether they really did. - if (! $i3_autostart) { - return unless $i3_pid; - - $tester->ok(undef, 'testcase called exit_gracefully()'); - } + # Skip the remaining cleanup for testcases which set i3_autostart => 0: + return if !defined($i3_pid) && !$i3_autostart; # don't trigger SIGCHLD handler local $SIG{CHLD}; diff --git a/testcases/t/000-load-deps.t b/testcases/t/000-load-deps.t index e0408338..65795305 100644 --- a/testcases/t/000-load-deps.t +++ b/testcases/t/000-load-deps.t @@ -11,7 +11,6 @@ BEGIN { IPC::Run ExtUtils::PkgConfig Inline - Test::More ); for my $dep (@deps) { use_ok($dep) or BAIL_OUT(qq|The Perl module "$dep" could not be loaded. Please see http://build.i3wm.org/docs/testsuite.html#_installing_the_dependencies|);