$self->{verbose} = $ENV{TEST_VERBOSE} || 0;
+ # Optional extra tables and tests
+ $self->{extra} ||= {};
+
return bless $self => $class;
}
sub run_tests {
my $self = shift;
- plan tests => 108;
+ plan tests => 108 + ($self->{extra}->{count} || 0);
$self->create();
my @connect_info = ( $self->{dsn}, $self->{user}, $self->{password} );
my %loader_opts = (
- constraint => qr/^(?:\S+\.)?loader_test[0-9]+$/i,
+ constraint => qr/^(?:\S+\.)?(?:$self->{vendor}_)?loader_test[0-9]+$/i,
relationships => 1,
additional_classes => 'TestAdditional',
additional_base_classes => 'TestAdditionalBase',
my $obj30 = $rsobj30->find(123);
isa_ok( $obj30->loader_test2, $class2);
}
+
+ $self->{extra}->{run}->($conn, $monikers, $classes) if $self->{extra}->{run};
}
sub dbconnect {
$dbh->do($_) for (@statements_implicit_rels);
}
}
+
+ $dbh->do($_) for @{ $self->{extra}->{create} || [] };
$dbh->disconnect();
}
my $dbh = $self->dbconnect(0);
+ $dbh->do("DROP TABLE $_") for @{ $self->{extra}->{drop} || [] };
+
unless($self->{skip_rels}) {
$dbh->do("DROP TABLE $_") for (@tables_reltests);
unless($self->{vendor} =~ /sqlite/i) {