X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F10_02mysql_common.t;h=082ac5281cb04cf326ffd912adcfa180fb476ecd;hb=3b7ea110ea6e400d497b05e8e366db10e30abfdb;hp=e850cbf1b2b95b4dec2be00168e00f18510491d0;hpb=4fb2971cd5784d8bc64f98052e691db9df697516;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/t/10_02mysql_common.t b/t/10_02mysql_common.t index e850cbf..082ac52 100644 --- a/t/10_02mysql_common.t +++ b/t/10_02mysql_common.t @@ -1,10 +1,12 @@ +use DBIx::Class::Schema::Loader::Optional::Dependencies + -skip_all_without => 'test_rdbms_mysql'; + use strict; use warnings; use Test::More; use Test::Exception; use Try::Tiny; use File::Path 'rmtree'; -use DBIx::Class::Optional::Dependencies; use DBIx::Class::Schema::Loader::Utils 'slurp_file'; use DBIx::Class::Schema::Loader 'make_schema_at'; @@ -26,7 +28,9 @@ my $innodb = $test_innodb ? q{Engine=InnoDB} : ''; my ($schema, $databases_created); # for cleanup in END for extra tests -my $tester = dbixcsl_common_tests->new( +diag $skip_rels_msg if not $test_innodb; + +dbixcsl_common_tests->new( vendor => 'Mysql', auto_inc_pk => 'INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT', innodb => $innodb, @@ -115,7 +119,6 @@ my $tester = dbixcsl_common_tests->new( 'time' => { data_type => 'time' }, 'year' => { data_type => 'year' }, 'year(4)' => { data_type => 'year' }, - 'year(2)' => { data_type => 'year', size => 2 }, # String Types 'char' => { data_type => 'char', size => 1 }, @@ -337,7 +340,7 @@ EOF $dbh->selectall_arrayref('SHOW DATABASES'); } catch { - skip 'no SHOW DATABASES privileges', 28; + skip 'no SHOW DATABASES privileges', 30; } } @@ -500,18 +503,7 @@ EOF } }, }, -); - -if( !$dsn || !$user ) { - $tester->skip_tests('You need to set the DBICTEST_MYSQL_DSN, DBICTEST_MYSQL_USER, and DBICTEST_MYSQL_PASS environment variables'); -} -elsif (!DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_mysql')) { - $tester->skip_tests('You need to install ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_mysql')); -} -else { - diag $skip_rels_msg if not $test_innodb; - $tester->run_tests(); -} +)->run_tests; END { if (not $ENV{SCHEMA_LOADER_TESTS_NOCLEANUP}) {