[Bast-commits] r8187 - in
branches/DBIx-Class-Schema-Loader/deprecate_CDA: .
lib/DBIx/Class/Schema/Loader t t/backcompat/0.04006
t/backcompat/0.04006/lib
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Wed Dec 30 21:01:17 GMT 2009
Author: caelum
Date: 2009-12-30 21:01:16 +0000 (Wed, 30 Dec 2009)
New Revision: 8187
Modified:
branches/DBIx-Class-Schema-Loader/deprecate_CDA/
branches/DBIx-Class-Schema-Loader/deprecate_CDA/Makefile.PL
branches/DBIx-Class-Schema-Loader/deprecate_CDA/lib/DBIx/Class/Schema/Loader/Base.pm
branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/20invocations.t
branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/24loader_subclass.t
branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/backcompat/0.04006/20invocations.t
branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/backcompat/0.04006/22dump.t
branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/backcompat/0.04006/lib/dbixcsl_common_tests.pm
Log:
r22312 at hlagh (orig r8185): caelum | 2009-12-30 12:30:58 -0500
bump File::Path dep, fixup redefined warning handler
r22313 at hlagh (orig r8186): caelum | 2009-12-30 15:58:06 -0500
fix tests
Property changes on: branches/DBIx-Class-Schema-Loader/deprecate_CDA
___________________________________________________________________
Name: svk:merge
- 46bc3436-8211-0410-8564-d96f7a728040:/local/DBIx-Class-Schema-Loader/branches/common-dump:37173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-Schema-Loader/back-compat:8172
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-Schema-Loader/mssql_tweaks:7407
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-Schema-Loader/odbc-mssql:6439
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class-Schema-Loader:5726
+ 46bc3436-8211-0410-8564-d96f7a728040:/local/DBIx-Class-Schema-Loader/branches/common-dump:37173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-Schema-Loader/back-compat:8172
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-Schema-Loader/current:8186
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-Schema-Loader/mssql_tweaks:7407
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-Schema-Loader/odbc-mssql:6439
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class-Schema-Loader:5726
Modified: branches/DBIx-Class-Schema-Loader/deprecate_CDA/Makefile.PL
===================================================================
--- branches/DBIx-Class-Schema-Loader/deprecate_CDA/Makefile.PL 2009-12-30 20:58:06 UTC (rev 8186)
+++ branches/DBIx-Class-Schema-Loader/deprecate_CDA/Makefile.PL 2009-12-30 21:01:16 UTC (rev 8187)
@@ -6,7 +6,7 @@
test_requires 'Test::More' => '0.94';
test_requires 'DBI' => '1.56';
test_requires 'DBD::SQLite' => '1.12';
-test_requires 'File::Path' => 0;
+test_requires 'File::Path' => '2.07';
test_requires 'IPC::Open3' => 0;
test_requires 'Test::Exception';
Modified: branches/DBIx-Class-Schema-Loader/deprecate_CDA/lib/DBIx/Class/Schema/Loader/Base.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/deprecate_CDA/lib/DBIx/Class/Schema/Loader/Base.pm 2009-12-30 20:58:06 UTC (rev 8186)
+++ branches/DBIx-Class-Schema-Loader/deprecate_CDA/lib/DBIx/Class/Schema/Loader/Base.pm 2009-12-30 21:01:16 UTC (rev 8187)
@@ -417,7 +417,7 @@
my ($v) = $real_ver =~ /([1-9])/;
$v = "v$v";
- last if $v eq CURRENT_V;
+ last if $v eq CURRENT_V || $real_ver =~ /^0\.04999/;
if (not %{ $self->naming }) {
warn <<"EOF" unless $ENV{SCHEMA_LOADER_BACKCOMPAT};
@@ -518,8 +518,10 @@
if ($self->dynamic) { # load the class too
# kill redefined warnings
+ my $warn_handler = $SIG{__WARN__} || sub { warn @_ };
local $SIG{__WARN__} = sub {
- warn @_ unless $_[0] =~ /^Subroutine \S+ redefined/;
+ $warn_handler->(@_)
+ unless $_[0] =~ /^Subroutine \S+ redefined/;
};
do $real_inc_path;
die $@ if $@;
@@ -545,8 +547,10 @@
new name of the Result.
EOF
# kill redefined warnings
+ my $warn_handler = $SIG{__WARN__} || sub { warn @_ };
local $SIG{__WARN__} = sub {
- warn @_ unless $_[0] =~ /^Subroutine \S+ redefined/;
+ $warn_handler->(@_)
+ unless $_[0] =~ /^Subroutine \S+ redefined/;
};
my $code = do {
local ($/, @ARGV) = (undef, $old_real_inc_path); <>
@@ -736,10 +740,11 @@
delete $INC{ $class_path };
# kill redefined warnings
+ my $warn_handler = $SIG{__WARN__} || sub { warn @_ };
local $SIG{__WARN__} = sub {
- warn @_ unless $_[0] =~ /^Subroutine \S+ redefined/;
+ $warn_handler->(@_)
+ unless $_[0] =~ /^Subroutine \S+ redefined/;
};
-
eval "require $class;";
}
Modified: branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/20invocations.t
===================================================================
--- branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/20invocations.t 2009-12-30 20:58:06 UTC (rev 8186)
+++ branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/20invocations.t 2009-12-30 21:01:16 UTC (rev 8187)
@@ -28,6 +28,7 @@
'hardcode' => sub {
package DBICTest::Schema::5;
use base qw/ DBIx::Class::Schema::Loader /;
+ __PACKAGE__->naming('current');
__PACKAGE__->connection($make_dbictest_db::dsn);
__PACKAGE__;
},
@@ -35,13 +36,14 @@
package DBICTest::Schema::6;
use base qw/ DBIx::Class::Schema::Loader /;
__PACKAGE__->loader_options();
+ __PACKAGE__->naming('current');
__PACKAGE__->connect($make_dbictest_db::dsn);
},
'make_schema_at' => sub {
use DBIx::Class::Schema::Loader qw/ make_schema_at /;
make_schema_at(
'DBICTest::Schema::7',
- { really_erase_my_files => 1 },
+ { really_erase_my_files => 1, naming => 'current' },
[ $make_dbictest_db::dsn ],
);
DBICTest::Schema::7->clone;
@@ -49,6 +51,7 @@
'embedded_options' => sub {
package DBICTest::Schema::8;
use base qw/ DBIx::Class::Schema::Loader /;
+ __PACKAGE__->naming('current');
__PACKAGE__->connect(
$make_dbictest_db::dsn,
{ loader_options => { really_erase_my_files => 1 } }
@@ -57,6 +60,7 @@
'embedded_options_in_attrs' => sub {
package DBICTest::Schema::9;
use base qw/ DBIx::Class::Schema::Loader /;
+ __PACKAGE__->naming('current');
__PACKAGE__->connect(
$make_dbictest_db::dsn,
undef,
@@ -71,7 +75,10 @@
{ },
[
$make_dbictest_db::dsn,
- { loader_options => { really_erase_my_files => 1 } },
+ { loader_options => {
+ really_erase_my_files => 1,
+ naming => 'current'
+ } },
],
);
"DBICTest::Schema::10";
@@ -79,7 +86,10 @@
'almost_embedded' => sub {
package DBICTest::Schema::11;
use base qw/ DBIx::Class::Schema::Loader /;
- __PACKAGE__->loader_options( really_erase_my_files => 1 );
+ __PACKAGE__->loader_options(
+ really_erase_my_files => 1,
+ naming => 'current'
+ );
__PACKAGE__->connect(
$make_dbictest_db::dsn,
undef, undef, { AutoCommit => 1 }
@@ -89,7 +99,7 @@
use DBIx::Class::Schema::Loader;
DBIx::Class::Schema::Loader::make_schema_at(
'DBICTest::Schema::12',
- { really_erase_my_files => 1 },
+ { really_erase_my_files => 1, naming => 'current' },
[ $make_dbictest_db::dsn ],
);
DBICTest::Schema::12->clone;
Modified: branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/24loader_subclass.t
===================================================================
--- branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/24loader_subclass.t 2009-12-30 20:58:06 UTC (rev 8186)
+++ branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/24loader_subclass.t 2009-12-30 21:01:16 UTC (rev 8187)
@@ -12,19 +12,21 @@
loader_class => sub {
package DBICTest::Schema::1;
use base qw/ DBIx::Class::Schema::Loader /;
+ __PACKAGE__->naming('current');
__PACKAGE__->loader_class(shift);
__PACKAGE__->connect($make_dbictest_db::dsn);
},
connect_info => sub {
package DBICTeset::Schema::2;
use base qw/ DBIx::Class::Schema::Loader /;
+ __PACKAGE__->naming('current');
__PACKAGE__->connect($make_dbictest_db::dsn, { loader_class => shift });
},
make_schema_at => sub {
use DBIx::Class::Schema::Loader qw/ make_schema_at /;
make_schema_at(
'DBICTeset::Schema::3',
- { },
+ { naming => 'current' },
[ $make_dbictest_db::dsn, { loader_class => shift } ]
);
}
Modified: branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/backcompat/0.04006/20invocations.t
===================================================================
--- branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/backcompat/0.04006/20invocations.t 2009-12-30 20:58:06 UTC (rev 8186)
+++ branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/backcompat/0.04006/20invocations.t 2009-12-30 21:01:16 UTC (rev 8187)
@@ -6,6 +6,10 @@
plan skip_all => 'set SCHEMA_LOADER_TESTS_BACKCOMPAT to enable these tests'
unless $ENV{SCHEMA_LOADER_TESTS_BACKCOMPAT};
+local $SIG{__WARN__} = sub {
+ warn @_ unless $_[0] =~ /Dynamic schema|really_erase_my_files/;
+};
+
# Takes a $schema as input, runs 4 basic tests
sub test_schema {
my ($testname, $schema) = @_;
Modified: branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/backcompat/0.04006/22dump.t
===================================================================
--- branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/backcompat/0.04006/22dump.t 2009-12-30 20:58:06 UTC (rev 8186)
+++ branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/backcompat/0.04006/22dump.t 2009-12-30 21:01:16 UTC (rev 8187)
@@ -9,6 +9,11 @@
my $dump_path = './t/_dump';
+local $SIG{__WARN__} = sub {
+ warn @_ unless $_[0] =~
+ /^Dumping manual schema|really_erase_my_files|^Schema dump complete/;
+};
+
{
package DBICTest::Schema::1;
use base qw/ DBIx::Class::Schema::Loader /;
Modified: branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/backcompat/0.04006/lib/dbixcsl_common_tests.pm
===================================================================
--- branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/backcompat/0.04006/lib/dbixcsl_common_tests.pm 2009-12-30 20:58:06 UTC (rev 8186)
+++ branches/DBIx-Class-Schema-Loader/deprecate_CDA/t/backcompat/0.04006/lib/dbixcsl_common_tests.pm 2009-12-30 21:01:16 UTC (rev 8187)
@@ -88,6 +88,7 @@
my $warn_count = 0;
$warn_count++ if grep /ResultSetManager/, @loader_warnings;
+ $warn_count++ if grep /Dynamic schema detected/, @loader_warnings;
if($self->{skip_rels}) {
is(scalar(@loader_warnings), $warn_count)
@@ -500,10 +501,18 @@
q{ INSERT INTO loader_test30 (id,loader_test2) VALUES(321, 2) },
);
- my $dbh = $self->dbconnect(1);
- $dbh->do($_) for @statements_rescan;
- $dbh->disconnect;
+ {
+ # Silence annoying but harmless postgres "NOTICE: CREATE TABLE..."
+ local $SIG{__WARN__} = sub {
+ my $msg = shift;
+ warn $msg unless $msg =~ m{^NOTICE:\s+CREATE TABLE};
+ };
+ my $dbh = $self->dbconnect(1);
+ $dbh->do($_) for @statements_rescan;
+ $dbh->disconnect;
+ }
+
my @new = $conn->rescan;
is(scalar(@new), 1);
is($new[0], 'LoaderTest30');
@@ -852,7 +861,7 @@
# Silence annoying but harmless postgres "NOTICE: CREATE TABLE..."
local $SIG{__WARN__} = sub {
my $msg = shift;
- print STDERR $msg unless $msg =~ m{^NOTICE:\s+CREATE TABLE};
+ warn $msg unless $msg =~ m{^NOTICE:\s+CREATE TABLE};
};
$dbh->do($_) for (@statements);
More information about the Bast-commits
mailing list