From 8e75243721dae1a087337813c223ce9760eec8ab Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 23 Apr 2020 18:42:44 +0200 Subject: fix a warning causing Test::More to think it failed when /proc is not mounted You tried to plan twice at t/superuser--should-restart.t line 14. t/superuser--should-restart.t ................................... skipped: (no reason given) (...) Test Summary Report ------------------- t/superuser--should-restart.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Files=40, Tests=3901, 801 wallclock secs ( 0.96 usr 0.09 sys + 174.18 cusr 30.16 csys = 205.39 CPU) Result: FAIL Failed 1/40 test programs. 0/3901 subtests failed.A On the other side we want to make it work in both cases so we end doing that. --- t/superuser--should-restart.t | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 't') diff --git a/t/superuser--should-restart.t b/t/superuser--should-restart.t index f9b282ef..4943e241 100644 --- a/t/superuser--should-restart.t +++ b/t/superuser--should-restart.t @@ -10,8 +10,14 @@ $ENV{URPMI_TEST_RESTART} = 1; use strict; use lib '.', 't'; use helper; -use Test::More 'no_plan'; -plan skip_all => "A mounted /proc is required for those tests due to urpm::sys::_launched_time() relying on /proc/uptime" if ! -d "/proc/$$"; +use Test::More; +BEGIN { + if (-d "/proc/$$") { + plan 'no_plan'; + } else { + plan skip_all => "A mounted /proc is required for those tests due to urpm::sys::_launched_time() relying on /proc/uptime"; + } +} need_root_and_prepare(); -- cgit v1.2.1