use FindBin qw/$Bin/;
use SQL::Translator;
+use SQL::Translator::Utils qw/ddl_parser_instance/;
### Set $ENV{SQLTTEST_RT_DEBUG} = 1 for more output
my $plan = [
{
engine => 'XML',
- req => 'XML::LibXML',
+ req => 'XML::LibXML 1.69',
+ no_grammar => 1,
},
{
engine => 'YAML',
+ no_grammar => 1,
},
{
parser_args => {},
todo => 'Needs volunteers',
},
- {
- engine => 'DB2',
- producer_args => {},
- parser_args => {},
- todo => 'Needs volunteers',
- },
+# too noisy under new P::RD
+# {
+# engine => 'DB2',
+# producer_args => {},
+# parser_args => {},
+# todo => 'Needs volunteers',
+# },
# There is no Access producer
# {
my @req = ref $args->{req} ? @{$args->{req}} : $args->{req}||();
my @missing;
for (@req) {
- eval "require $_";
+ eval "use $_ ()";
push @missing, $_ if ($@);
}
if (@missing) {
);
}
+ use_ok("SQL::Translator::Producer::$args->{engine}");
+ use_ok("SQL::Translator::Parser::$args->{engine}");
+
+ ok(ddl_parser_instance($args->{engine}), 'Got proper parser instance')
+ unless $args->{no_grammar};
+
TODO: {
local $TODO = $args->{todo} if $args->{todo};
+ no warnings 'once';
+ # silence PR::D from spewing on STDERR
+ local $::RD_ERRORS = 0 if $args->{todo};
+ local $::RD_WARN = 0 if $args->{todo};
+ local $::RD_HINT = 0 if $args->{todo};
+
lives_ok (
sub { check_roundtrip ($args, $base_schema) },
"Round trip for $args->{name} did not throw an exception",
isa_ok ($mid_schema, 'SQL::Translator::Schema', "First $args->{name} parser pass produced a schema:")
or do {
diag (_gen_diag ( $parser_t->error, $base_out ) );
+ my $i;
+ note join ("\n" . ( '=' x 76) . "\n",
+ 'Unparseable DDL:',
+ (join ("\n", map { ++$i . ":\t$_" } split /\n/, $base_out) ),
+ ''
+ );
return;
};