From: Karen Etheridge Date: Sun, 17 May 2020 23:19:27 +0000 (-0700) Subject: use Test::Needs for backend tests X-Git-Tag: v1.004002~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=17528b049f9ab8b840a21c9e806dd4fc44b0263c;p=p5sagit%2FJSON-MaybeXS.git use Test::Needs for backend tests This ensures that the releaser runs *all* tests. --- diff --git a/Makefile.PL b/Makefile.PL index 29ffa80..5ed0bbc 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -29,6 +29,7 @@ my %META = ( test => { requires => { 'Test::More' => '0.88', + 'Test::Needs' => '0.002006', }, }, }, diff --git a/t/cpanel.t b/t/cpanel.t index 417d11e..a3bddef 100644 --- a/t/cpanel.t +++ b/t/cpanel.t @@ -3,10 +3,7 @@ use warnings; use Test::More 0.88; use JSON::MaybeXS; -unless ( eval { require Cpanel::JSON::XS; 1 } ) { - plan skip_all => 'No Cpanel::JSON::XS'; -} - +use Test::Needs 'Cpanel::JSON::XS'; diag 'Using Cpanel::JSON::XS ', Cpanel::JSON::XS->VERSION; is( JSON, 'Cpanel::JSON::XS', 'Correct JSON class' ); diff --git a/t/pp.t b/t/pp.t index df3d2b3..aae5f0f 100644 --- a/t/pp.t +++ b/t/pp.t @@ -7,7 +7,7 @@ use lib map { sub { return unless $_[1] eq $m; die "Can't locate $m in \@INC (hidden).\n" }; } qw{Cpanel/JSON/XS.pm JSON/XS.pm}; -use if !eval { require JSON::PP; 1; }, 'Test::More', skip_all => 'No JSON::PP'; +use Test::Needs 'JSON::PP'; use Test::More 0.88; use JSON::MaybeXS; diff --git a/t/preload_cpanel.t b/t/preload_cpanel.t index 231e9ea..660be54 100644 --- a/t/preload_cpanel.t +++ b/t/preload_cpanel.t @@ -1,6 +1,7 @@ use strict; use warnings; -use if !eval { require Cpanel::JSON::XS; 1; }, 'Test::More', skip_all => 'No Cpanel::JSON::XS'; + +use Test::Needs 'Cpanel::JSON::XS'; # load first, before JSON::MaybeXS use Test::More 0.88; use JSON::MaybeXS; diff --git a/t/preload_xs.t b/t/preload_xs.t index 539b524..48dcf1d 100644 --- a/t/preload_xs.t +++ b/t/preload_xs.t @@ -1,7 +1,7 @@ use strict; use warnings; -use if !eval { require JSON::XS; JSON::XS->VERSION(3.0); 1; }, 'Test::More', skip_all => 'No JSON::XS'; +use Test::Needs { 'JSON::XS' => '3.0' }; # load first, before JSON::MaybeXS use Test::More 0.88; use JSON::MaybeXS; diff --git a/t/xs.t b/t/xs.t index 405e7f1..ddae943 100644 --- a/t/xs.t +++ b/t/xs.t @@ -10,10 +10,7 @@ use lib map { use Test::More 0.88; use JSON::MaybeXS; -unless ( eval { require JSON::XS; 1 } ) { - plan skip_all => 'No JSON::XS'; -} - +use Test::Needs 'JSON::XS'; diag 'Using JSON::XS ', JSON::XS->VERSION; is( JSON, 'JSON::XS', 'Correct JSON class' );