Use skip_all or diag for missing RDBMS test dependencies
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / 10_03pg_common.t
index c1b75b3..0c66a3c 100644 (file)
@@ -1,6 +1,7 @@
 use strict;
 use warnings;
 use utf8;
+use DBIx::Class::Optional::Dependencies;
 use DBIx::Class::Schema::Loader 'make_schema_at';
 use DBIx::Class::Schema::Loader::Utils qw/no_warnings slurp_file/;
 use Test::More;
@@ -489,6 +490,9 @@ my $tester = dbixcsl_common_tests->new(
 if( !$dsn || !$user ) {
     $tester->skip_tests('You need to set the DBICTEST_PG_DSN, _USER, and _PASS environment variables');
 }
+elsif (!DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_pg')) {
+    $tester->skip_tests('You need to install ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_pg'));
+}
 else {
     $tester->run_tests();
 }