Bugzilla – Attachment 33582 Details for
Bug 11401
Add support for Norwegian national library card
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11401: (followup) make tests run on absent deps
Bug-11401-followup-make-tests-run-on-absent-deps.patch (text/plain), 2.27 KB, created by
Tomás Cohen Arazi (tcohen)
on 2014-11-14 18:37:57 UTC
(
hide
)
Description:
Bug 11401: (followup) make tests run on absent deps
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2014-11-14 18:37:57 UTC
Size:
2.27 KB
patch
obsolete
>From 348bca3dbb200627b3f3fd3ae9aae2d012892ecd Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Fri, 14 Nov 2014 15:28:55 -0300 >Subject: [PATCH] Bug 11401: (followup) make tests run on absent deps > >The current code breaks if a dependency is missing. The evals are >rearranged so there's no error on missing dependency. > >To reproduce: >- Have a dependency for t/NorwegianPatronDB.t removed >- Run > $ prove t/NorwegianPatronDB.t >=> FAIL: You see an error similar to this (may vary depending on the lib you removed): > >t/NorwegianPatronDB.t .. You tried to plan twice at t/NorwegianPatronDB.t line 37. > >- Apply the patch >- Run > $ prove t/NorwegianPatronDB.t >=> SUCCESS: Tests are skipped on missing lib > >Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> >--- > t/NorwegianPatronDB.t | 27 ++++++++++++++++----------- > 1 file changed, 16 insertions(+), 11 deletions(-) > >diff --git a/t/NorwegianPatronDB.t b/t/NorwegianPatronDB.t >index 4f05d91..1f0808c 100644 >--- a/t/NorwegianPatronDB.t >+++ b/t/NorwegianPatronDB.t >@@ -16,43 +16,48 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 73; >+use Test::More; > use Test::MockModule; > use t::lib::Mocks; > use Data::Dumper; > > # Check that all the modules we need are installed, or bail out > BEGIN { >+ my $missing_lib; > eval { > require Test::DBIx::Class; > 1; > } or do { >- plan skip_all => "Test::DBIx::Class is not available"; >+ $missing_lib = "Test::DBIx::Class"; > }; >-} >-BEGIN { >+ > eval { > require SOAP::Lite; > 1; > } or do { >- plan skip_all => "SOAP::Lite is not available"; >+ $missing_lib = "SOAP::Lite"; > }; >-} >-BEGIN { >+ > eval { > require Crypt::GCrypt; > 1; > } or do { >- plan skip_all => "Crypt::GCrypt is not available"; >+ $missing_lib = "Crypt::GCrypt"; > }; >-} >-BEGIN { >+ > eval { > require Convert::BaseN; > 1; > } or do { >- plan skip_all => "Convert::BaseN is not available"; >+ $missing_lib = "Convert::BaseN"; > }; >+ >+ if ( $missing_lib ) { >+ plan skip_all => $missing_lib . " is not available."; >+ } else { >+ # Everything good >+ plan tests => 73; >+ } > } > > use Test::DBIx::Class { >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11401
:
30752
|
31710
|
31711
|
31815
|
31816
|
32546
|
32607
|
32888
|
32889
|
32890
|
32949
|
32950
|
32951
|
32952
|
33528
|
33570
| 33582