diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2020-04-23 18:42:44 +0200 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2020-04-29 14:40:38 +0200 |
commit | 8e75243721dae1a087337813c223ce9760eec8ab (patch) | |
tree | 56690284203fb85dab713c4833e2a44680041749 /t | |
parent | 1b1f1b6e6c438855f132fdf0e58b9ec1cad0fbec (diff) | |
download | urpmi-8e75243721dae1a087337813c223ce9760eec8ab.tar urpmi-8e75243721dae1a087337813c223ce9760eec8ab.tar.gz urpmi-8e75243721dae1a087337813c223ce9760eec8ab.tar.bz2 urpmi-8e75243721dae1a087337813c223ce9760eec8ab.tar.xz urpmi-8e75243721dae1a087337813c223ce9760eec8ab.zip |
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.
Diffstat (limited to 't')
-rw-r--r-- | t/superuser--should-restart.t | 10 |
1 files changed, 8 insertions, 2 deletions
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(); |