From: Rafael Kitover Date: Sat, 3 Apr 2010 21:44:24 +0000 (-0400) Subject: fix SCHEMA_LOADER_TESTS_EXTRA_ONLY X-Git-Tag: 0.06000~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=04dcecc885a874d392a63cc65d405b6e904b210f;p=dbsrgits%2FDBIx-Class-Schema-Loader.git fix SCHEMA_LOADER_TESTS_EXTRA_ONLY --- diff --git a/t/lib/dbixcsl_common_tests.pm b/t/lib/dbixcsl_common_tests.pm index ce381b1..c8fd70e 100644 --- a/t/lib/dbixcsl_common_tests.pm +++ b/t/lib/dbixcsl_common_tests.pm @@ -109,7 +109,9 @@ sub run_only_extra_tests { plan tests => @$connect_info * (4 + ($self->{extra}{count} || 0)); - foreach my $info (@$connect_info) { + foreach my $info_idx (0..$#$connect_info) { + my $info = $connect_info->[$info_idx]; + @{$self}{qw/dsn user password connect_info_opts/} = @$info; my $dbh = $self->dbconnect(0); @@ -123,6 +125,12 @@ sub run_only_extra_tests { my $conn = $schema_class->clone; $self->{extra}{run}->($conn, $monikers, $classes) if $self->{extra}{run}; + + if (not ($ENV{SCHEMA_LOADER_TESTS_NOCLEANUP} && $info_idx == $#$connect_info)) { + $dbh->do($_) for @{ $self->{extra}{pre_drop_ddl} || [] }; + $dbh->do("DROP TABLE $_") for @{ $self->{extra}{drop} || [] }; + rmtree $DUMP_DIR; + } } }