X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fstorage%2Fquote_names.t;h=215c01140dca86aba47aa6c50bfb7b7d7c81e5d1;hb=6b44e3b08d4d855e971ccb756fc2038a7cb206cb;hp=bf46122b56b72381d56ebbf2b3aefe9a8aaa386e;hpb=619f81c4e80407520781678162e020ca8d7bf0ef;p=dbsrgits%2FDBIx-Class.git diff --git a/t/storage/quote_names.t b/t/storage/quote_names.t index bf46122..215c011 100644 --- a/t/storage/quote_names.t +++ b/t/storage/quote_names.t @@ -1,10 +1,12 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; -use Data::Dumper::Concise; -use Try::Tiny; -use lib qw(t/lib); + use DBICTest; +use DBIx::Class::_Util 'dump_value'; +$Data::Dumper::Indent = 0; my %expected = ( 'DBIx::Class::Storage::DBI' => @@ -50,14 +52,17 @@ my %expected = ( ); for my $class (keys %expected) { SKIP: { - eval "require ${class}" - or skip "Skipping test of quotes for $class due to missing dependencies", 1; + + eval "require ${class}" or do { + note "Failed load of $class:\n\n$@\n\n"; + skip "Skipping test of quotes for $class due to missing compile-time dependencies", 1; + }; my $mapping = $expected{$class}; my ($quote_char, $name_sep) = @$mapping{qw/quote_char name_sep/}; my $instance = $class->new; - my $quote_char_text = dumper($quote_char); + my $quote_char_text = dump_value $quote_char; if (exists $mapping->{quote_char}) { is_deeply $instance->sql_quote_char, $quote_char, @@ -89,7 +94,9 @@ my %dbs = ( ); # lie that we already locked stuff - the tests below do not touch anything -$ENV{DBICTEST_LOCK_HOLDER} = -1; +# unless we are under travis, where the OOM killers reign and things are rough +$ENV{DBICTEST_LOCK_HOLDER} = -1 + unless DBICTest::RunMode->is_ci; # Make sure oracle is tried last - some clients (e.g. 10.2) have symbol # clashes with libssl, and will segfault everything coming after them @@ -104,7 +111,7 @@ for my $db (sort { my $schema; - my $sql_maker = try { + my $sql_maker = eval { $schema = DBICTest::Schema->connect($dsn, $user, $pass, { quote_names => 1 }); @@ -115,7 +122,7 @@ for my $db (sort { my ($exp_quote_char, $exp_name_sep) = @{$expected{$dbs{$db}}}{qw/quote_char name_sep/}; - my ($quote_char_text, $name_sep_text) = map { dumper($_) } + my ($quote_char_text, $name_sep_text) = map { dump_value $_ } ($exp_quote_char, $exp_name_sep); is_deeply $sql_maker->quote_char, @@ -130,9 +137,9 @@ for my $db (sort { # if something was produced - it better be quoted if ( # the SQLT producer has no idea what quotes are :/ - $db ne 'SYBASE' + ! grep { $db eq $_ } qw( SYBASE DB2 ) and - my $ddl = try { $schema->deployment_statements } + my $ddl = eval { $schema->deployment_statements } ) { my $quoted_artist = $sql_maker->_quote('artist'); @@ -141,13 +148,3 @@ for my $db (sort { } done_testing; - -sub dumper { - my $val = shift; - - my $dd = DumperObject; - $dd->Indent(0); - return $dd->Values([ $val ])->Dump; -} - -1;