From: Darren Chamberlain Date: Wed, 26 Feb 2003 13:11:42 +0000 (+0000) Subject: o Added bin/auto-dia.pl to scripts list X-Git-Tag: v0.01~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cc3742ae8fccacfea573d17720eabf62316a3353;p=dbsrgits%2FSQL-Translator.git o Added bin/auto-dia.pl to scripts list o Added a test for auto-dia (which might be questionable). o Added GD to module prerequisite list o Changed VERSION number, in anticipation of an intial release. --- diff --git a/MANIFEST b/MANIFEST index 3ec147c..70c2b33 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3,6 +3,7 @@ Changes MANIFEST MANIFEST.SKIP Makefile.PL +README TODO bin/auto-dia.pl bin/sql_translator.pl @@ -28,5 +29,6 @@ t/05bgep-re.t t/06xsv.t t/07p_args.t t/08postgres-to-mysql.t +t/09auto-dia.t t/data/mysql/Apache-Session-MySQL.sql t/data/mysql/BGEP-RE-create.sql diff --git a/Makefile.PL b/Makefile.PL index 8e5e8de..4d6ebd4 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -5,14 +5,16 @@ use ExtUtils::MakeMaker; WriteMakefile( 'NAME' => __PACKAGE__, - 'VERSION_FROM' => "lib/SQL/Translator.pm", + 'VERSION' => 0.01, 'EXE_FILES' => [ + 'bin/auto-dia.pl', 'bin/sql_translator.pl', ], 'PREREQ_PM' => { 'Class::Base' => 0, 'File::Basename' => 0, 'File::Spec' => 0, + 'GD' => 0, 'IO::Dir' => 0, 'Parse::RecDescent' => 0, # Is a particular version needed? 'Pod::Usage' => 0, diff --git a/t/09auto-dia.t b/t/09auto-dia.t new file mode 100644 index 0000000..613e333 --- /dev/null +++ b/t/09auto-dia.t @@ -0,0 +1,42 @@ +#!/usr/bin/perl +# vim: set ft=perl: + +use strict; + +use File::Spec::Functions qw(catfile updir tmpdir); +use File::Temp qw(tempfile); +use FindBin qw($Bin); +use Test; + +my @script = qw(blib script auto-dia.pl); +my @data = qw(data mysql Apache-Session-MySQL.sql); + +my $auto_dia = (-d "blib") + ? catfile($Bin, updir, @script) + : catfile($Bin, @script); + +my $test_data = (-d "t") + ? catfile($Bin, @data) + : catfile($Bin, "t", @data); + +my (undef, $tmp) = tempfile("sqlXXXXX", + OPEN => 0, + UNLINK => 1, + SUFFIX => '.png', + DIR => tmpdir); + +BEGIN { + plan tests => 3; +} + +ok(-e $auto_dia); +eval { require GD; }; +if ($@ && $@ =~ /locate GD.pm in /) { + skip($@, "GD not installed"); + skip($@, "GD not installed"); +} else { + my @cmd = ($auto_dia, "-d", "MySQL", "-o", $tmp, $test_data); + eval { system(@cmd); }; + ok(!$@ && ($? == 0)); + ok(-e $tmp); +}