use strict;
-use Test::More tests => 180;
+use Test::More;
use SQL::Translator;
-use SQL::Translator::Parser::MySQL qw(parse);
use SQL::Translator::Schema::Constants;
+eval {
+ require SQL::Translator::Parser::MySQL;
+ SQL::Translator::Parser::MySQL->import('parse');
+};
+if ($@) {
+ plan skip_all => "$@";
+}
+else {
+ plan tests => 180;
+}
+
{
my $tr = SQL::Translator->new;
my $data = q|create table sessions (
use SQL::Translator;
use Test::More tests => 2;
+# This aggravates me; XML::Writer produces tons of warnings.
+local $SIG{__WARN__} = sub {
+ CORE::warn(@_)
+ unless $_[0] =~ m#XML/Writer#;
+};
+
my @data = qw(data mysql BGEP-RE-create.sql);
my $test_data = (-d "t")
? catfile($Bin, @data)
use SQL::Translator;
use SQL::Translator::Schema;
use SQL::Translator::Schema::Constants;
-use SQL::Translator::Parser::xSV qw(parse);
-use Test::More tests => 25;
+use Test::More;
+
+eval {
+ require SQL::Translator::Parser::xSV;
+ SQL::Translator::Parser::xSV->import('parse');
+};
+if ($@) {
+ plan skip_all => "$@";
+}
+else {
+ plan tests => 25;
+}
my $tr = SQL::Translator->new;
my $s = SQL::Translator::Schema->new;
#!/usr/bin/perl
# vim: set ft=perl:
-use Test::More tests => 31;
+use Test::More;
use SQL::Translator;
-use SQL::Translator::Parser::Excel 'parse';
use SQL::Translator::Schema::Constants;
+eval {
+ require SQL::Translator::Parser::Excel;
+ SQL::Translator::Parser::Excel->import('parse');
+};
+if ($@) {
+ plan skip_all => "$@";
+}
+else {
+ plan tests => 31;
+}
+
my $tr = SQL::Translator->new(parser => "Excel");
my $t = $tr->translate(filename => "t/data/Excel/t.xls");
my $schema = $tr->schema;
#!/usr/bin/perl
+# vim: set ft=perl:
use strict;
-use Test::More tests => 117;
+use Test::More;
use SQL::Translator;
use SQL::Translator::Schema::Constants;
-use SQL::Translator::Parser::PostgreSQL qw(parse);
+
+eval {
+ require SQL::Translator::Parser::PostgreSQL;
+ SQL::Translator::Parser::PostgreSQL->import('parse');
+};
+if ($@) {
+ plan skip_all => "$@";
+}
+else {
+ plan tests => 117;
+}
my $t = SQL::Translator->new( trace => 0 );
my $sql = q[
#!/usr/bin/perl
+# vim: set ft=perl:
use strict;
-use Test::More tests => 76;
+use Test::More;
use SQL::Translator;
use SQL::Translator::Schema::Constants;
-use SQL::Translator::Parser::Oracle qw(parse);
+
+eval {
+ require SQL::Translator::Parser::Oracle;
+ SQL::Translator::Parser::Oracle->import('parse');
+};
+if ($@) {
+ plan skip_all => "$@";
+}
+else {
+ plan tests => 76;
+}
my $t = SQL::Translator->new( trace => 0 );
my $sql = q[
my $file = "$Bin/data/mysql/sqlfxml-producer-basic.sql";
+local $SIG{__WARN__} = sub {
+ CORE::warn(@_)
+ unless $_[0] =~ m#XML/Writer#;
+};
# Testing 1,2,3,4...
#=============================================================================