From: Peter Rabbitson Date: Tue, 9 Jun 2009 20:59:36 +0000 (+0000) Subject: More test sanification X-Git-Tag: v0.11008~155 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9f25d3c5fe3f5cda250c6cc7c8eaeb271d3810ca;p=dbsrgits%2FSQL-Translator.git More test sanification --- diff --git a/t/09sqlt-diagram.t b/t/09sqlt-diagram.t index 6935c51..157206f 100644 --- a/t/09sqlt-diagram.t +++ b/t/09sqlt-diagram.t @@ -25,7 +25,7 @@ my $test_data = catfile($Bin, @data); my $tmp = mktemp('sqlXXXXX'); ok(-e $sqlt_diagram); -my @cmd = ($sqlt_diagram, "-d", "MySQL", "-o", $tmp, $test_data); +my @cmd = ($^X, $sqlt_diagram, "-d", "MySQL", "-o", $tmp, $test_data); eval { system(@cmd); }; ok(!$@ && ($? == 0)); ok(-e $tmp); diff --git a/t/30sqlt-diff.t b/t/30sqlt-diff.t index 4b9c3a4..90abd7d 100644 --- a/t/30sqlt-diff.t +++ b/t/30sqlt-diff.t @@ -25,7 +25,7 @@ BEGIN { } ok(-e $sqlt_diff, 'Found sqlt-diff script'); -my @cmd = ($sqlt_diff, "$create1=SQLite", "$create2=SQLite"); +my @cmd = ($^X, $sqlt_diff, "$create1=SQLite", "$create2=SQLite"); my $out = `@cmd`; like($out, qr/-- Target database SQLite is untested/, "Detected 'untested' comment"); @@ -33,7 +33,7 @@ like($out, qr/ALTER TABLE person CHANGE iq/, "Detected altered 'iq' field"); like($out, qr/ALTER TABLE person ADD is_rock_star/, "Detected missing rock star field"); -@cmd = ($sqlt_diff, "$create1=SQLite", "$create1=SQLite"); +@cmd = ($^X, $sqlt_diff, "$create1=SQLite", "$create1=SQLite"); $out = `@cmd`; like($out, qr/There were no differences/, "Properly detected no differences"); @@ -50,7 +50,7 @@ my $mysql_create2 = (-d "t") : catfile($Bin, "t", @mysql_create2); # Test for differences -@cmd = ($sqlt_diff, "$mysql_create1=MySQL", "$mysql_create2=MySQL"); +@cmd = ($^X, $sqlt_diff, "$mysql_create1=MySQL", "$mysql_create2=MySQL"); $out = `@cmd`; unlike($out, qr/-- Target database MySQL is untested/, "Did not detect 'untested' comment"); @@ -73,7 +73,7 @@ like($out, qr/ALTER TABLE employee ADD CONSTRAINT FK5302D47D93FE702E_diff/, unlike($out, qr/ALTER TABLE employee ADD PRIMARY KEY/, "Primary key looks different when it shouldn't"); # Test for sameness -@cmd = ($sqlt_diff, "$mysql_create1=MySQL", "$mysql_create1=MySQL"); +@cmd = ($^X, $sqlt_diff, "$mysql_create1=MySQL", "$mysql_create1=MySQL"); $out = `@cmd`; like($out, qr/There were no differences/, "Properly detected no differences"); @@ -89,7 +89,7 @@ my $oracle_create2 = (-d "t") ? catfile($Bin, @oracle_create2) : catfile($Bin, "t", @oracle_create2); -@cmd = ($sqlt_diff, "$oracle_create1=Oracle", "$oracle_create2=Oracle"); +@cmd = ($^X, $sqlt_diff, "$oracle_create1=Oracle", "$oracle_create2=Oracle"); $out = `@cmd`; unlike($out, qr/-- Target database Oracle is untested/, "Did not detect 'untested' comment"); diff --git a/t/61translator_agnostic.t b/t/61translator_agnostic.t index f35abca..e706717 100644 --- a/t/61translator_agnostic.t +++ b/t/61translator_agnostic.t @@ -2,10 +2,15 @@ use warnings; use strict; -use Test::More qw/no_plan/; -use Test::Exception; +use Test::More; +use Test::SQL::Translator; use FindBin qw/$Bin/; +BEGIN { + maybe_plan(1, 'SQL::Translator::Parser::XML', + 'SQL::Translator::Producer::XML'); +} + use SQL::Translator; # Producing a schema with a Translator different from the one the schema was