[Bast-commits] r7581 - in DBIx-Class/0.08/trunk: . script t t/cdbi/testlib t/lib/DBICTest

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Sun Sep 6 15:39:03 GMT 2009


Author: ribasushi
Date: 2009-09-06 15:39:03 +0000 (Sun, 06 Sep 2009)
New Revision: 7581

Removed:
   DBIx-Class/0.08/trunk/t/cdbi/testlib/Binary.pm
   DBIx-Class/0.08/trunk/t/cdbi/testlib/PgBase.pm
Modified:
   DBIx-Class/0.08/trunk/Makefile.PL
   DBIx-Class/0.08/trunk/script/dbicadmin
   DBIx-Class/0.08/trunk/t/02pod.t
   DBIx-Class/0.08/trunk/t/03podcoverage.t
   DBIx-Class/0.08/trunk/t/26dumper.t
   DBIx-Class/0.08/trunk/t/lib/DBICTest/AuthorCheck.pm
   DBIx-Class/0.08/trunk/t/zzzzzzz_perl_perf_bug.t
Log:
Test cleanup:
Benchmark and Data::Dumper have been in core forever
Make POD testing conditional as shown in http://use.perl.org/~Alias/journal/38822
Remove some dead cdbi test files
Stop openly giving contributors an option to override the authorcheck


Modified: DBIx-Class/0.08/trunk/Makefile.PL
===================================================================
--- DBIx-Class/0.08/trunk/Makefile.PL	2009-09-06 13:45:51 UTC (rev 7580)
+++ DBIx-Class/0.08/trunk/Makefile.PL	2009-09-06 15:39:03 UTC (rev 7581)
@@ -61,9 +61,15 @@
   %replication_requires,
 
 #  'Module::Install::Pod::Inherit' => '0.01',
-  'Test::Pod::Coverage'       => '1.04',
   'SQL::Translator'           => $sqlt_recommends,
 
+  # when changing also adjust version in t/02pod.t
+  'Test::Pod'                 => '1.26',
+
+  # when changing also adjust version in t/03podcoverage.t
+  'Test::Pod::Coverage'       => '1.08',
+  'Pod::Coverage'             => '0.20',
+
   # CDBI-compat related
   'DBIx::ContextualFetch'     => '0',
   'Class::DBI::Plugin::DeepAbstractSearch' => '0',

Modified: DBIx-Class/0.08/trunk/script/dbicadmin
===================================================================
--- DBIx-Class/0.08/trunk/script/dbicadmin	2009-09-06 13:45:51 UTC (rev 7580)
+++ DBIx-Class/0.08/trunk/script/dbicadmin	2009-09-06 15:39:03 UTC (rev 7581)
@@ -30,7 +30,7 @@
 }
 
 pod2usage(1) if ($help);
-$ENV{DBIX_CLASS_STORAGE_DBI_DEBUG} = 1 if ($trace);
+$ENV{DBIC_TRACE} = 1 if ($trace);
 
 die('No op specified') if(!$op);
 die('Invalid op') if ($op!~/^insert|update|delete|select$/s);

Modified: DBIx-Class/0.08/trunk/t/02pod.t
===================================================================
--- DBIx-Class/0.08/trunk/t/02pod.t	2009-09-06 13:45:51 UTC (rev 7580)
+++ DBIx-Class/0.08/trunk/t/02pod.t	2009-09-06 15:39:03 UTC (rev 7581)
@@ -1,6 +1,27 @@
+use warnings;
+use strict;
+
 use Test::More;
+use lib qw(t/lib);
+use DBICTest;
 
-eval "use Test::Pod 1.14";
-plan skip_all => 'Test::Pod 1.14 required' if $@;
+my @MODULES = (
+  'Test::Pod 1.26',
+);
 
+# Don't run tests for installs
+unless ( DBICTest::AuthorCheck->is_author || $ENV{AUTOMATED_TESTING} || $ENV{RELEASE_TESTING} ) {
+  plan( skip_all => "Author tests not required for installation" );
+}
+
+# Load the testing modules
+foreach my $MODULE ( @MODULES ) {
+  eval "use $MODULE";
+  if ( $@ ) {
+    $ENV{RELEASE_TESTING}
+    ? die( "Failed to load required release-testing module $MODULE" )
+    : plan( skip_all => "$MODULE not available for testing" );
+  }
+}
+
 all_pod_files_ok();

Modified: DBIx-Class/0.08/trunk/t/03podcoverage.t
===================================================================
--- DBIx-Class/0.08/trunk/t/03podcoverage.t	2009-09-06 13:45:51 UTC (rev 7580)
+++ DBIx-Class/0.08/trunk/t/03podcoverage.t	2009-09-06 15:39:03 UTC (rev 7581)
@@ -1,14 +1,30 @@
+use warnings;
+use strict;
+
 use Test::More;
 use List::Util ();
+use lib qw(t/lib);
+use DBICTest;
 
-eval "use Pod::Coverage 0.19";
-plan skip_all => 'Pod::Coverage 0.19 required' if $@;
-eval "use Test::Pod::Coverage 1.04";
-plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
+my @MODULES = (
+  'Test::Pod::Coverage 1.08',
+  'Pod::Coverage 0.20',
+);
 
-plan skip_all => 'set TEST_POD to enable this test'
-  unless ($ENV{TEST_POD} || -e 'MANIFEST.SKIP');
+# Don't run tests for installs
+unless ( DBICTest::AuthorCheck->is_author || $ENV{AUTOMATED_TESTING} || $ENV{RELEASE_TESTING} ) {
+  plan( skip_all => "Author tests not required for installation" );
+}
 
+# Load the testing modules
+foreach my $MODULE ( @MODULES ) {
+  eval "use $MODULE";
+  if ( $@ ) {
+    $ENV{RELEASE_TESTING}
+    ? die( "Failed to load required release-testing module $MODULE" )
+    : plan( skip_all => "$MODULE not available for testing" );
+  }
+}
 
 # Since this is about checking documentation, a little documentation
 # of what this is doing might be in order.

Modified: DBIx-Class/0.08/trunk/t/26dumper.t
===================================================================
--- DBIx-Class/0.08/trunk/t/26dumper.t	2009-09-06 13:45:51 UTC (rev 7580)
+++ DBIx-Class/0.08/trunk/t/26dumper.t	2009-09-06 15:39:03 UTC (rev 7581)
@@ -6,15 +6,6 @@
 $Data::Dumper::Sortkeys = 1;
 
 use lib qw(t/lib);
-
-BEGIN {
-    eval "use DBD::SQLite";
-    plan $ENV{DATA_DUMPER_TEST}
-        ? ( tests => 2 )
-        : ( skip_all => 'Set $ENV{DATA_DUMPER_TEST} to run this test' );
-}
-
-
 use_ok('DBICTest');
 
 my $schema = DBICTest->init_schema();
@@ -36,4 +27,4 @@
 
 cmp_ok( $rs->count(), '==', 1, "Single record in after death with dumper");
 
-1;
+done_testing;

Deleted: DBIx-Class/0.08/trunk/t/cdbi/testlib/Binary.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/cdbi/testlib/Binary.pm	2009-09-06 13:45:51 UTC (rev 7580)
+++ DBIx-Class/0.08/trunk/t/cdbi/testlib/Binary.pm	2009-09-06 15:39:03 UTC (rev 7581)
@@ -1,16 +0,0 @@
-package # hide from PAUSE
-    Binary;
-
-use strict;
-use base 'PgBase';
-
-__PACKAGE__->table(cdbibintest => 'cdbibintest');
-__PACKAGE__->sequence('binseq');
-__PACKAGE__->columns(All => qw(id bin));
-
-# __PACKAGE__->data_type(bin => DBI::SQL_BINARY);
-
-sub schema { "id INTEGER, bin BYTEA" }
-
-1;
-

Deleted: DBIx-Class/0.08/trunk/t/cdbi/testlib/PgBase.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/cdbi/testlib/PgBase.pm	2009-09-06 13:45:51 UTC (rev 7580)
+++ DBIx-Class/0.08/trunk/t/cdbi/testlib/PgBase.pm	2009-09-06 15:39:03 UTC (rev 7581)
@@ -1,23 +0,0 @@
-package # hide from PAUSE 
-    PgBase;
-
-use strict;
-use base 'DBIx::Class::CDBICompat';
-
-my $db   = $ENV{DBD_PG_DBNAME} || 'template1';
-my $user = $ENV{DBD_PG_USER}   || 'postgres';
-my $pass = $ENV{DBD_PG_PASSWD} || '';
-
-__PACKAGE__->connection("dbi:Pg:dbname=$db", $user, $pass,
-	{ AutoCommit => 1 });
-
-sub CONSTRUCT {
-	my $class = shift;
-	my ($table, $sequence) = ($class->table, $class->sequence || "");
-	my $schema = $class->schema;
-	$class->db_Main->do("CREATE TEMPORARY SEQUENCE $sequence") if $sequence;
-	$class->db_Main->do("CREATE TEMPORARY TABLE $table ( $schema )");
-}
-
-1;
-

Modified: DBIx-Class/0.08/trunk/t/lib/DBICTest/AuthorCheck.pm
===================================================================
--- DBIx-Class/0.08/trunk/t/lib/DBICTest/AuthorCheck.pm	2009-09-06 13:45:51 UTC (rev 7580)
+++ DBIx-Class/0.08/trunk/t/lib/DBICTest/AuthorCheck.pm	2009-09-06 15:39:03 UTC (rev 7581)
@@ -54,21 +54,17 @@
 We have a number of reasons to believe that this is a development
 checkout and that you, the user, did not run `perl Makefile.PL`
 before using this code. You absolutely _must_ perform this step,
-as not doing so often results in a lot of wasted time for other
-contributors trying to assit you with "it broke!" problems.
+and ensure you have all required dependencies present. Not doing
+so often results in a lot of wasted time for other contributors
+trying to assit you with spurious "its broken!" problems.
 
 If you are seeing this message unexpectedly (i.e. you are in fact
-attempting a regular installation be it through CPAN or manually,
-set the variable DBICTEST_NO_MAKEFILE_VERIFICATION to a true value
-so you can continue. Also _make_absolutely_sure_ to report this to
-either the mailing list or to the irc channel as described in
+attempting a regular installation be it through CPAN or manually),
+please report the situation to either the mailing list or to the
+irc channel as described in
 
 http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class.pm#GETTING_HELP/SUPPORT
 
-Failure to do this will make us believe that all these checks are
-indeed foolproof and we will remove the ability to override this
-entirely.
-
 The DBIC team
 
 
@@ -79,6 +75,19 @@
   }
 }
 
+# Mimic $Module::Install::AUTHOR
+sub is_author {
+
+  my $root = _find_co_root()
+    or return undef;
+
+  return (
+    ( not -d $root->subdir ('inc') )
+      or
+    ( -e $root->subdir ('inc')->file ($^O eq 'VMS' ? '_author' : '.author') )
+  );
+}
+
 # Try to determine the root of a checkout/untar if possible
 # or return undef
 sub _find_co_root {

Modified: DBIx-Class/0.08/trunk/t/zzzzzzz_perl_perf_bug.t
===================================================================
--- DBIx-Class/0.08/trunk/t/zzzzzzz_perl_perf_bug.t	2009-09-06 13:45:51 UTC (rev 7580)
+++ DBIx-Class/0.08/trunk/t/zzzzzzz_perl_perf_bug.t	2009-09-06 15:39:03 UTC (rev 7581)
@@ -1,6 +1,7 @@
 use strict;
 use warnings;
 use Test::More;
+use Benchmark;
 use lib qw(t/lib);
 use DBICTest; # do not remove even though it is not used
 
@@ -25,9 +26,6 @@
 plan skip_all => 'Skipping as AUTOMATED_TESTING is set'
   if ( $ENV{AUTOMATED_TESTING} );
 
-eval "use Benchmark ':all'";
-plan skip_all => 'needs Benchmark for testing' if $@;
-
 plan tests => 3;
 
 ok( 1, 'Dummy - prevents next test timing out' );




More information about the Bast-commits mailing list