6 use dbixcsl_test_dir qw/$tdir/;
8 my $dump_path = "$tdir/dump";
10 local $SIG{__WARN__} = sub {
11 warn $_[0] unless $_[0] =~
12 /really_erase_my_files|Dumping manual schema|Schema dump completed/;
16 package DBICTest::Schema::1;
17 use base qw/ DBIx::Class::Schema::Loader /;
18 __PACKAGE__->loader_options(
19 dump_directory => $dump_path,
24 package DBICTest::Schema::2;
25 use base qw/ DBIx::Class::Schema::Loader /;
26 __PACKAGE__->loader_options(
27 dump_directory => $dump_path,
28 really_erase_my_files => 1,
34 rmtree($dump_path, 1, 1);
36 eval { DBICTest::Schema::1->connect($make_dbictest_db::dsn) };
37 ok(!$@, 'no death with dump_directory set') or diag "Dump failed: $@";
39 DBICTest::Schema::1->_loader_invoked(undef);
42 my @warnings_regexes = (
43 qr|Dumping manual schema|,
44 qr|Schema dump completed|,
47 skip "ActiveState perl produces additional warnings", scalar @warnings_regexes
48 if ($^O eq 'MSWin32');
52 local $SIG{__WARN__} = sub { push(@warn_output, @_) };
53 DBICTest::Schema::1->connect($make_dbictest_db::dsn);
56 like(shift @warn_output, $_) foreach (@warnings_regexes);
58 rmtree($dump_path, 1, 1);
61 eval { DBICTest::Schema::2->connect($make_dbictest_db::dsn) };
62 ok(!$@, 'no death with dump_directory set (overwrite1)')
63 or diag "Dump failed: $@";
65 DBICTest::Schema::2->_loader_invoked(undef);
66 eval { DBICTest::Schema::2->connect($make_dbictest_db::dsn) };
67 ok(!$@, 'no death with dump_directory set (overwrite2)')
68 or diag "Dump failed: $@";
70 END { rmtree($dump_path, 1, 1); }