From f7258b734c034e94379d884abefcbc1a051b2e65 Mon Sep 17 00:00:00 2001 From: vti Date: Tue, 18 Nov 2008 01:45:05 +0100 Subject: [PATCH] skip tests unless DBD::SQLite installed --- Rose-DBx-Object-I18N/Changes | 3 ++ Rose-DBx-Object-I18N/lib/Rose/DBx/Object/I18N.pm | 2 +- .../t/available-translations-after-prefetch.t | 7 ++- .../t/available-translations-before-load-i18n.t | 7 ++- Rose-DBx-Object-I18N/t/available-translations.t | 7 ++- Rose-DBx-Object-I18N/t/boilerplate.t | 55 ---------------------- Rose-DBx-Object-I18N/t/delete-i18n.t | 7 ++- Rose-DBx-Object-I18N/t/delete.t | 7 ++- Rose-DBx-Object-I18N/t/i18n-is-original-loaded.t | 9 +++- Rose-DBx-Object-I18N/t/init.t | 7 ++- Rose-DBx-Object-I18N/t/insert-with-fake-columns.t | 7 ++- Rose-DBx-Object-I18N/t/insert-with-i18n-data.t | 9 +++- Rose-DBx-Object-I18N/t/insert.t | 9 +++- .../t/load-i18n-with-default-language.t | 7 ++- .../t/load-i18n-with-wrong-language.t | 9 +++- Rose-DBx-Object-I18N/t/load-i18n.t | 9 +++- Rose-DBx-Object-I18N/t/load-with-i18n.t | 7 ++- Rose-DBx-Object-I18N/t/load.t | 7 ++- Rose-DBx-Object-I18N/t/manager.t | 7 ++- Rose-DBx-Object-I18N/t/not-translated-i18n.t | 9 +++- Rose-DBx-Object-I18N/t/prefetch.t | 9 +++- Rose-DBx-Object-I18N/t/update-original.t | 9 +++- .../t/update-translation-on-demand.t | 9 +++- .../t/update-translation-with-sync.t | 9 +++- Rose-DBx-Object-I18N/t/update-translation.t | 9 +++- Rose-DBx-Object-I18N/t/zzcleanup.t | 7 ++- 26 files changed, 153 insertions(+), 90 deletions(-) delete mode 100644 Rose-DBx-Object-I18N/t/boilerplate.t diff --git a/Rose-DBx-Object-I18N/Changes b/Rose-DBx-Object-I18N/Changes index 6465ca4..46cbafa 100644 --- a/Rose-DBx-Object-I18N/Changes +++ b/Rose-DBx-Object-I18N/Changes @@ -1,5 +1,8 @@ Revision history for Rose-DBx-Object-I18N +0.04 2008-11-18 00:00:00 + - skip tests unless DBD::SQLite is installed + 0.03 2008-11-09 00:00:00 - RDBO_I18N_LANG as a new $ENV variable to hold default language - Fix wrong column selection in Helpers diff --git a/Rose-DBx-Object-I18N/lib/Rose/DBx/Object/I18N.pm b/Rose-DBx-Object-I18N/lib/Rose/DBx/Object/I18N.pm index d119db2..64582b4 100644 --- a/Rose-DBx-Object-I18N/lib/Rose/DBx/Object/I18N.pm +++ b/Rose-DBx-Object-I18N/lib/Rose/DBx/Object/I18N.pm @@ -14,7 +14,7 @@ use Rose::DBx::Object::I18N::Helpers ':all'; our $Debug = 0; -our $VERSION = 0.03; +our $VERSION = 0.04; =head1 NAME diff --git a/Rose-DBx-Object-I18N/t/available-translations-after-prefetch.t b/Rose-DBx-Object-I18N/t/available-translations-after-prefetch.t index 9d8e423..3d590d7 100644 --- a/Rose-DBx-Object-I18N/t/available-translations-after-prefetch.t +++ b/Rose-DBx-Object-I18N/t/available-translations-after-prefetch.t @@ -3,7 +3,12 @@ use strict; use warnings; -use Test::More 'tests' => 2; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 2; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/available-translations-before-load-i18n.t b/Rose-DBx-Object-I18N/t/available-translations-before-load-i18n.t index 05b2c1b..787ce91 100644 --- a/Rose-DBx-Object-I18N/t/available-translations-before-load-i18n.t +++ b/Rose-DBx-Object-I18N/t/available-translations-before-load-i18n.t @@ -3,7 +3,12 @@ use strict; use warnings; -use Test::More 'tests' => 1; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 1; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/available-translations.t b/Rose-DBx-Object-I18N/t/available-translations.t index 57a1635..4206681 100644 --- a/Rose-DBx-Object-I18N/t/available-translations.t +++ b/Rose-DBx-Object-I18N/t/available-translations.t @@ -3,7 +3,12 @@ use strict; use warnings; -use Test::More 'tests' => 5; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 5; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/boilerplate.t b/Rose-DBx-Object-I18N/t/boilerplate.t deleted file mode 100644 index abd793e..0000000 --- a/Rose-DBx-Object-I18N/t/boilerplate.t +++ /dev/null @@ -1,55 +0,0 @@ -#!perl -T - -use strict; -use warnings; -use Test::More tests => 3; - -sub not_in_file_ok { - my ($filename, %regex) = @_; - open( my $fh, '<', $filename ) - or die "couldn't open $filename for reading: $!"; - - my %violated; - - while (my $line = <$fh>) { - while (my ($desc, $regex) = each %regex) { - if ($line =~ $regex) { - push @{$violated{$desc}||=[]}, $.; - } - } - } - - if (%violated) { - fail("$filename contains boilerplate text"); - diag "$_ appears on lines @{$violated{$_}}" for keys %violated; - } else { - pass("$filename contains no boilerplate text"); - } -} - -sub module_boilerplate_ok { - my ($module) = @_; - not_in_file_ok($module => - 'the great new $MODULENAME' => qr/ - The great new /, - 'boilerplate description' => qr/Quick summary of what the module/, - 'stub function definition' => qr/function[12]/, - ); -} - -TODO: { - local $TODO = "Need to replace the boilerplate text"; - - not_in_file_ok(README => - "The README is used..." => qr/The README is used/, - "'version information here'" => qr/to provide version information/, - ); - - not_in_file_ok(Changes => - "placeholder date/time" => qr(Date/time) - ); - - module_boilerplate_ok('lib/Rose/DBx/Object/I18N.pm'); - - -} - diff --git a/Rose-DBx-Object-I18N/t/delete-i18n.t b/Rose-DBx-Object-I18N/t/delete-i18n.t index 16e3c54..64ce389 100644 --- a/Rose-DBx-Object-I18N/t/delete-i18n.t +++ b/Rose-DBx-Object-I18N/t/delete-i18n.t @@ -3,7 +3,12 @@ use strict; use warnings; -use Test::More 'tests' => 3; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 3; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/delete.t b/Rose-DBx-Object-I18N/t/delete.t index 0669913..02a4924 100644 --- a/Rose-DBx-Object-I18N/t/delete.t +++ b/Rose-DBx-Object-I18N/t/delete.t @@ -3,7 +3,12 @@ use strict; use warnings; -use Test::More 'tests' => 4; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 4; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/i18n-is-original-loaded.t b/Rose-DBx-Object-I18N/t/i18n-is-original-loaded.t index 006a951..081e91d 100644 --- a/Rose-DBx-Object-I18N/t/i18n-is-original-loaded.t +++ b/Rose-DBx-Object-I18N/t/i18n-is-original-loaded.t @@ -1,9 +1,14 @@ -#! /usr/bin/perl +#!/usr/bin/perl use strict; use warnings; -use Test::More 'tests' => 4; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 4; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/init.t b/Rose-DBx-Object-I18N/t/init.t index 9cc3d3d..57982cc 100644 --- a/Rose-DBx-Object-I18N/t/init.t +++ b/Rose-DBx-Object-I18N/t/init.t @@ -3,7 +3,12 @@ use strict; use warnings; -use Test::More 'tests' => 8; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 8; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/insert-with-fake-columns.t b/Rose-DBx-Object-I18N/t/insert-with-fake-columns.t index 4657135..f7915e1 100644 --- a/Rose-DBx-Object-I18N/t/insert-with-fake-columns.t +++ b/Rose-DBx-Object-I18N/t/insert-with-fake-columns.t @@ -3,7 +3,12 @@ use strict; use warnings; -use Test::More 'tests' => 4; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 4; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/insert-with-i18n-data.t b/Rose-DBx-Object-I18N/t/insert-with-i18n-data.t index 6c4899c..bea36ce 100644 --- a/Rose-DBx-Object-I18N/t/insert-with-i18n-data.t +++ b/Rose-DBx-Object-I18N/t/insert-with-i18n-data.t @@ -1,9 +1,14 @@ -#! /usr/bin/perl +#!/usr/bin/perl use strict; use warnings; -use Test::More 'tests' => 3; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 3; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/insert.t b/Rose-DBx-Object-I18N/t/insert.t index 5e03d20..a3bac93 100644 --- a/Rose-DBx-Object-I18N/t/insert.t +++ b/Rose-DBx-Object-I18N/t/insert.t @@ -1,9 +1,14 @@ -#! /usr/bin/perl +#!/usr/bin/perl use strict; use warnings; -use Test::More 'tests' => 4; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 4; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/load-i18n-with-default-language.t b/Rose-DBx-Object-I18N/t/load-i18n-with-default-language.t index 4982b31..dd880a9 100644 --- a/Rose-DBx-Object-I18N/t/load-i18n-with-default-language.t +++ b/Rose-DBx-Object-I18N/t/load-i18n-with-default-language.t @@ -3,7 +3,12 @@ use strict; use warnings; -use Test::More 'tests' => 2; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 2; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/load-i18n-with-wrong-language.t b/Rose-DBx-Object-I18N/t/load-i18n-with-wrong-language.t index d71de2c..167a60b 100644 --- a/Rose-DBx-Object-I18N/t/load-i18n-with-wrong-language.t +++ b/Rose-DBx-Object-I18N/t/load-i18n-with-wrong-language.t @@ -1,9 +1,14 @@ -#! /usr/bin/perl +#!/usr/bin/perl use strict; use warnings; -use Test::More 'tests' => 3; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 3; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/load-i18n.t b/Rose-DBx-Object-I18N/t/load-i18n.t index 7ae65e2..2bac1ac 100644 --- a/Rose-DBx-Object-I18N/t/load-i18n.t +++ b/Rose-DBx-Object-I18N/t/load-i18n.t @@ -1,9 +1,14 @@ -#! /usr/bin/perl +#!/usr/bin/perl use strict; use warnings; -use Test::More 'tests' => 9; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 9; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/load-with-i18n.t b/Rose-DBx-Object-I18N/t/load-with-i18n.t index 5192e55..26fd02b 100644 --- a/Rose-DBx-Object-I18N/t/load-with-i18n.t +++ b/Rose-DBx-Object-I18N/t/load-with-i18n.t @@ -3,7 +3,12 @@ use strict; use warnings; -use Test::More 'tests' => 2; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 2; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/load.t b/Rose-DBx-Object-I18N/t/load.t index d9361fc..722fe97 100644 --- a/Rose-DBx-Object-I18N/t/load.t +++ b/Rose-DBx-Object-I18N/t/load.t @@ -3,7 +3,12 @@ use strict; use warnings; -use Test::More 'tests' => 5; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 5; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/manager.t b/Rose-DBx-Object-I18N/t/manager.t index 2daf0c5..c4e4b7a 100644 --- a/Rose-DBx-Object-I18N/t/manager.t +++ b/Rose-DBx-Object-I18N/t/manager.t @@ -3,7 +3,12 @@ use strict; use warnings; -use Test::More 'tests' => 11; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 11; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/not-translated-i18n.t b/Rose-DBx-Object-I18N/t/not-translated-i18n.t index 1b7b6e7..3df93d2 100644 --- a/Rose-DBx-Object-I18N/t/not-translated-i18n.t +++ b/Rose-DBx-Object-I18N/t/not-translated-i18n.t @@ -1,9 +1,14 @@ -#! /usr/bin/perl +#!/usr/bin/perl use strict; use warnings; -use Test::More 'tests' => 1; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 1; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/prefetch.t b/Rose-DBx-Object-I18N/t/prefetch.t index 8833cc8..76e3904 100644 --- a/Rose-DBx-Object-I18N/t/prefetch.t +++ b/Rose-DBx-Object-I18N/t/prefetch.t @@ -1,9 +1,14 @@ -#! /usr/bin/perl +#!/usr/bin/perl use strict; use warnings; -use Test::More 'tests' => 2; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 2; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/update-original.t b/Rose-DBx-Object-I18N/t/update-original.t index 3320a49..1328099 100644 --- a/Rose-DBx-Object-I18N/t/update-original.t +++ b/Rose-DBx-Object-I18N/t/update-original.t @@ -1,9 +1,14 @@ -#! /usr/bin/perl +#!/usr/bin/perl use strict; use warnings; -use Test::More 'tests' => 3; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 3; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/update-translation-on-demand.t b/Rose-DBx-Object-I18N/t/update-translation-on-demand.t index 69d0fb5..b31b1a2 100644 --- a/Rose-DBx-Object-I18N/t/update-translation-on-demand.t +++ b/Rose-DBx-Object-I18N/t/update-translation-on-demand.t @@ -1,9 +1,14 @@ -#! /usr/bin/perl +#!/usr/bin/perl use strict; use warnings; -use Test::More 'tests' => 3; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 3; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/update-translation-with-sync.t b/Rose-DBx-Object-I18N/t/update-translation-with-sync.t index 9db46f0..a9744d3 100644 --- a/Rose-DBx-Object-I18N/t/update-translation-with-sync.t +++ b/Rose-DBx-Object-I18N/t/update-translation-with-sync.t @@ -1,9 +1,14 @@ -#! /usr/bin/perl +#!/usr/bin/perl use strict; use warnings; -use Test::More 'tests' => 3; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 3; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/update-translation.t b/Rose-DBx-Object-I18N/t/update-translation.t index b17272a..a623c56 100644 --- a/Rose-DBx-Object-I18N/t/update-translation.t +++ b/Rose-DBx-Object-I18N/t/update-translation.t @@ -1,9 +1,14 @@ -#! /usr/bin/perl +#!/usr/bin/perl use strict; use warnings; -use Test::More 'tests' => 3; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 3; use lib 't/lib'; diff --git a/Rose-DBx-Object-I18N/t/zzcleanup.t b/Rose-DBx-Object-I18N/t/zzcleanup.t index 5284695..eac0c04 100644 --- a/Rose-DBx-Object-I18N/t/zzcleanup.t +++ b/Rose-DBx-Object-I18N/t/zzcleanup.t @@ -3,7 +3,12 @@ use strict; use warnings; -use Test::More 'tests' => 1; +use Test::More; + +eval "use DBD::SQLite"; +plan skip_all => "DBD::SQLite is required to run this test" if $@; + +plan 'tests' => 1; use lib 't/lib'; -- 2.11.4.GIT