3 use lib qw(t/backcompat/0.04006/lib);
7 plan skip_all => 'set SCHEMA_LOADER_TESTS_BACKCOMPAT to enable these tests'
8 unless $ENV{SCHEMA_LOADER_TESTS_BACKCOMPAT};
10 my $dump_path = './t/_dump';
12 local $SIG{__WARN__} = sub {
13 warn @_ unless $_[0] =~
14 /^Dumping manual schema|really_erase_my_files|^Schema dump complete/;
18 package DBICTest::Schema::1;
19 use base qw/ DBIx::Class::Schema::Loader /;
20 __PACKAGE__->loader_options(
21 dump_directory => $dump_path,
26 package DBICTest::Schema::2;
27 use base qw/ DBIx::Class::Schema::Loader /;
28 __PACKAGE__->loader_options(
29 dump_directory => $dump_path,
30 really_erase_my_files => 1,
36 rmtree($dump_path, 1, 1);
38 eval { DBICTest::Schema::1->connect($make_dbictest_db::dsn) };
39 ok(!$@, 'no death with dump_directory set') or diag "Dump failed: $@";
41 DBICTest::Schema::1->_loader_invoked(undef);
44 my @warnings_regexes = (
45 qr|Dumping manual schema|,
46 qr|Schema dump completed|,
49 skip "ActiveState perl produces additional warnings", scalar @warnings_regexes
50 if ($^O eq 'MSWin32');
54 local $SIG{__WARN__} = sub { push(@warn_output, @_) };
55 DBICTest::Schema::1->connect($make_dbictest_db::dsn);
58 like(shift @warn_output, $_) foreach (@warnings_regexes);
60 rmtree($dump_path, 1, 1);
63 eval { DBICTest::Schema::2->connect($make_dbictest_db::dsn) };
64 ok(!$@, 'no death with dump_directory set (overwrite1)')
65 or diag "Dump failed: $@";
67 DBICTest::Schema::2->_loader_invoked(undef);
68 eval { DBICTest::Schema::2->connect($make_dbictest_db::dsn) };
69 ok(!$@, 'no death with dump_directory set (overwrite2)')
70 or diag "Dump failed: $@";
72 END { rmtree($dump_path, 1, 1); }