From ed51861575bd2ee50b9da93186b7f303014e2773 Mon Sep 17 00:00:00 2001 From: Chris Travers Date: Sat, 12 Apr 2014 06:57:56 -0700 Subject: [PATCH] Fixing failing test cases due to optional dependencies not installed. --- Changes | 13 +++++++++++++ README | 2 +- lib/LaTeX/Driver.pm | 6 +++--- t/10-simpledoc.t | 4 +++- t/15-bibtex.t | 6 +++++- t/30-output-to-variable.t | 5 ++++- t/31-input-from-variable.t | 5 ++++- t/lib/Test/LaTeX/Driver.pm | 1 - 8 files changed, 33 insertions(+), 9 deletions(-) diff --git a/Changes b/Changes index baaaef6..430fdcd 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,18 @@ Revision history for the LaTeX::Driver module -*- indented-text -*- +0.200.4 2014-04-12 + - Disabled bibtex tests by default due to frequently not found LaTex + sty not found. + + - Disabled t/30 and t/31 unless dvips is found + +0.200.3 2014-04-11 + - xelatex tests now optional because they add too many external + dependencies + +0.200.1 2014-04-10 + - Fixed stale dependency (unused) in Test::LaTeX::Driver + 0.20 2014-04-09 - Removed IPC::ShellCmd dependency since newer versions not on CPAN - Fixed Win32 support diff --git a/README b/README index a7e37eb..6ae4aa5 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME LaTeX::Driver - Latex driver VERSION - This document describes version 0.20 of "LaTeX::Driver". + This document describes version 0.200.4 of "LaTeX::Driver". SYNOPSIS use LaTeX::Driver; diff --git a/lib/LaTeX/Driver.pm b/lib/LaTeX/Driver.pm index 8690550..da9aef0 100644 --- a/lib/LaTeX/Driver.pm +++ b/lib/LaTeX/Driver.pm @@ -38,7 +38,7 @@ use File::pushd; # temporary cwd changes Readonly our $DEFAULT_MAXRUNS => 10; -our $VERSION = "0.20"; +our $VERSION = "0.200.4"; __PACKAGE__->mk_accessors( qw( basename basedir basepath options source output tmpdir format timeout stderr @@ -674,7 +674,7 @@ sub run_command { my $exit_status; if ($OSNAME eq 'MSWin32') { $args = join(' ', @$args); - $cmd = "cmd /c \"$program $args\""; + $cmd = "\"$program\" $args"; $exit_status = system($cmd); } else { @@ -820,7 +820,7 @@ LaTeX::Driver - Latex driver =head1 VERSION -This document describes version 0.20 of C. +This document describes version 0.200.4 of C. =head1 SYNOPSIS diff --git a/t/10-simpledoc.t b/t/10-simpledoc.t index 58f6e64..5590494 100755 --- a/t/10-simpledoc.t +++ b/t/10-simpledoc.t @@ -8,7 +8,7 @@ use File::Spec; use lib ("$Bin/../lib", "$Bin/lib"); use Data::Dumper; -use Test::More tests => 24; +use Test::More; use Test::LaTeX::Driver; use LaTeX::Driver; @@ -18,6 +18,8 @@ my $drv = LaTeX::Driver->new( source => $docpath, format => 'dvi', @DEBUGOPTS ); +plan skip_all => 'FORMATTER_TESTING not set' unless $ENV{FORMATTER_TESTING}; +plan tests => 24; diag("Checking the formatting of a simple LaTeX document"); isa_ok($drv, 'LaTeX::Driver'); #is($drv->basedir, $basedir, "checking basedir"); diff --git a/t/15-bibtex.t b/t/15-bibtex.t index 5f57f34..a688348 100755 --- a/t/15-bibtex.t +++ b/t/15-bibtex.t @@ -8,11 +8,15 @@ use File::Spec; use lib ("$Bin/../lib", "$Bin/lib"); use Data::Dumper; -use Test::More tests => 8; +use Test::More; use Test::LaTeX::Driver; use LaTeX::Driver; +plan skip_all => 'BIBTEX_TESTS not set. Requires lastpage.sty.' + unless $ENV{BIBTEX_TESTS}; +plan tests => 8; + tidy_directory($basedir, $docname, $debug); my $drv = LaTeX::Driver->new( source => $docpath, diff --git a/t/30-output-to-variable.t b/t/30-output-to-variable.t index 46a9572..4a2a772 100755 --- a/t/30-output-to-variable.t +++ b/t/30-output-to-variable.t @@ -8,10 +8,13 @@ use File::Spec; use lib ("$Bin/../lib", "$Bin/lib"); use Data::Dumper; -use Test::More tests => 9; +use Test::More; use Test::LaTeX::Driver; use LaTeX::Driver; +plan skip_all => 'dvips not installed' if system('dvips -v'); +plan tests => 9; + tidy_directory($basedir, $docname, $debug); my $output; diff --git a/t/31-input-from-variable.t b/t/31-input-from-variable.t index 47d7e98..96305e7 100755 --- a/t/31-input-from-variable.t +++ b/t/31-input-from-variable.t @@ -8,11 +8,14 @@ use File::Spec; use lib ("$Bin/../lib", "$Bin/lib"); use Data::Dumper; -use Test::More tests => 11; +use Test::More; use Test::LaTeX::Driver; use LaTeX::Driver; use File::Slurp; +plan skip_all => 'dvips not installed' if system('dvips -v'); +plan tests => 11; + tidy_directory($basedir, $docname, $debug); my $source = read_file($docpath) or die "cannot read the source data"; diff --git a/t/lib/Test/LaTeX/Driver.pm b/t/lib/Test/LaTeX/Driver.pm index d8b9ed6..861430f 100644 --- a/t/lib/Test/LaTeX/Driver.pm +++ b/t/lib/Test/LaTeX/Driver.pm @@ -36,7 +36,6 @@ use warnings; use Config; use FindBin qw($Bin); use Getopt::Long; -use IPC::ShellCmd; use Test::More; require Exporter;