From: Craig A. Berry Date: Thu, 18 Jun 2009 03:08:28 +0000 (-0500) Subject: Remove CPANPLUS's SQLite tests from the core. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=906a0c07e328f0f22fcc032cc5b85bf246005a45;p=p5sagit%2Fp5-mst-13.2.git Remove CPANPLUS's SQLite tests from the core. They will never be run here in the absence of DBD::SQLite, and the absurdly long names can cause trouble for venerable but now exotic volume formats such as ODS-2 or FAT. --- diff --git a/MANIFEST b/MANIFEST index beaf19f..da15315 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2018,8 +2018,6 @@ lib/CPANPLUS/Shell.pm CPANPLUS lib/CPANPLUS/t/00_CPANPLUS-Internals-Utils.t CPANPLUS tests lib/CPANPLUS/t/01_CPANPLUS-Configure.t CPANPLUS tests lib/CPANPLUS/t/02_CPANPLUS-Internals.t CPANPLUS tests -lib/CPANPLUS/t/031_CPANPLUS-Internals-Source-SQLite.t CPANPLUS tests -lib/CPANPLUS/t/032_CPANPLUS-Internals-Source-via-sqlite.t CPANPLUS tests lib/CPANPLUS/t/03_CPANPLUS-Internals-Source.t CPANPLUS tests lib/CPANPLUS/t/04_CPANPLUS-Module.t CPANPLUS tests lib/CPANPLUS/t/05_CPANPLUS-Internals-Fetch.t CPANPLUS tests diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 167c3ce..f3bc86c 100644 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -419,6 +419,8 @@ package Maintainers; 'EXCLUDED' => [ qr{^inc/}, qr{^t/dummy-.*\.hidden$}, qw{ bin/cpanp-boxed + t/031_CPANPLUS-Internals-Source-SQLite.t + t/032_CPANPLUS-Internals-Source-via-sqlite.t }, ], 'CPAN' => 1, diff --git a/lib/CPANPLUS/t/031_CPANPLUS-Internals-Source-SQLite.t b/lib/CPANPLUS/t/031_CPANPLUS-Internals-Source-SQLite.t deleted file mode 100644 index 730e04b..0000000 --- a/lib/CPANPLUS/t/031_CPANPLUS-Internals-Source-SQLite.t +++ /dev/null @@ -1,80 +0,0 @@ -### make sure we can find our conf.pl file -BEGIN { - use FindBin; - require "$FindBin::Bin/inc/conf.pl"; -} - -use strict; - -use Module::Load; -use Test::More eval { load 'CPANPLUS::Internals::Source::SQLite'; 1 } - ? 'no_plan' - : (skip_all => "SQLite engine not available"); - -use Data::Dumper; -use File::Basename qw[dirname]; -use CPANPLUS::Error; -use CPANPLUS::Backend; -use CPANPLUS::Internals::Constants; - -my $conf = gimme_conf(); - -### make sure we use the SQLite engine -$conf->set_conf( source_engine => 'CPANPLUS::Internals::Source::SQLite' ); - -my $cb = CPANPLUS::Backend->new( $conf ); -my $mod = TEST_CONF_MODULE; -my $auth = TEST_CONF_AUTHOR; - -ok( $cb->reload_indices( update_source => 1 ), - "Building trees" ); -ok( $cb->__sqlite_dbh, " Got a DBH " ); -ok( $cb->__sqlite_file, " Got a DB file" ); - - -### make sure we have trees and they're hashes -{ ok( $cb->author_tree, "Got author tree" ); - isa_ok( $cb->author_tree, "HASH" ); - - ok( $cb->module_tree, "Got module tree" ); - isa_ok( $cb->module_tree, "HASH" ); -} - -### save state, shouldn't work -{ CPANPLUS::Error->flush; - my $rv = $cb->save_state; - - ok( !$rv, "Saving state not implemented" ); - like( CPANPLUS::Error->stack_as_string, qr/not implemented/i, - " Diagnostics confirmed" ); -} - -### test look ups -{ my %map = ( - $auth => 'author_tree', - $mod => 'module_tree', - ); - - while( my($str, $meth) = each %map ) { - - ok( $str, "Trying to retrieve $str" ); - ok( $cb->$meth( $str ), " Got $str object via ->$meth" ); - ok( $cb->$meth->{$str}, " Got author object via ->{ $str }" ); - ok( exists $cb->$meth->{ $str }, - " Testing exists() " ); - ok( not(exists( $cb->$meth->{ $$ } )), - " And non-exists() " ); - cmp_ok( scalar(keys(%{ $cb->$meth })), ">", 1, - " Got keys()" ); - - cmp_ok( scalar(keys(%{ $cb->$meth })), '==', scalar(keys(%{ $cb->$meth })), - " Keys == Values" ); - - while( my($key,$val) = each %{ $cb->$meth } ) { - ok( $key, " Retrieved $key via each()" ); - ok( $val, " And value" ); - ok( ref $val, " Value is a ref: $val" ); - can_ok( $val, '_id' ); - } - } -} diff --git a/lib/CPANPLUS/t/032_CPANPLUS-Internals-Source-via-sqlite.t b/lib/CPANPLUS/t/032_CPANPLUS-Internals-Source-via-sqlite.t deleted file mode 100644 index 46505f5..0000000 --- a/lib/CPANPLUS/t/032_CPANPLUS-Internals-Source-via-sqlite.t +++ /dev/null @@ -1,14 +0,0 @@ -use strict; -use FindBin; - -use Module::Load; - -local $ENV{CPANPLUS_SOURCE_ENGINE} = 'CPANPLUS::Internals::Source::SQLite'; - -my $old = select STDERR; $|++; -select $old; $|++; -my $rv = do("$FindBin::Bin/03_CPANPLUS-Internals-Source.t") or do { - die $@ if $@; - die $! if $!; -}; -