in reply to Re: Cannot redirect HTML output to a file using TAP::Formatter
in thread Cannot redirect HTML output to a file using TAP::Formatter

I'm relatively new to this.
Could you give me an example/sample code on how to use the output_fh accessor?

Your help is appreciated. Also, I'm not able to install the TAP::Formatter:HTML package using cpanm on Strawberry Perl + Windows. It just hangs at "Building and testing .. ". How do I get around that? :S
  • Comment on Re^2: Cannot redirect HTML output to a file using TAP::Formatter

Replies are listed 'Best First'.
Re^3: Cannot redirect HTML output to a file using TAP::Formatter
by Khen1950fx (Canon) on Jun 29, 2011 at 05:36 UTC
    TAP::Formatter::HTML has a large number of dependencies. Run this script:
    #!/usr/bin/perl use strict; use warnings; use CPAN; CPAN::Shell->install( "accessors", "ExtUtils::ParseXS", "Module::CoreList", "Module::Load", "Params::Check", "Module::Load::Conditional", "Locale::Maketext::Simple", "IPC::Cmd", "ExtUtils::CBuilder", "Perl::OSType", "IO::Dir", "Version::Requirements", "Exporter", "CPAN::Meta::YAML", "JSON::PP", "Parse::CPAN::Meta", "CPAN::Meta", "version", "Module::Metadata", "Module::Build", "AppConfig", "File::Temp", "File::Spec", "Scalar::Util", "Template", "MIME::Base64", "Test::More", "URI", "Test::Harness", "TAP::Formatter::HTML");
    Then run this:
    #!/usr/bin/perl use strict; use warnings; use TAP::Harness; use TAP::Formatter::HTML; my $fmt = TAP::Formatter::HTML->new; my @tests = glob('*.t'); my $harness = TAP::Harness->new( { formatter => $fmt, merge => 1 } ); $fmt->output_file('output.html'); $harness->runtests(@tests);
      Thanks fnord and Khen.

      Both of your suggestions collectively resolved my issue.
      1. PPM installed an older version of TFH module.
      2. I had to install all the dependencies before getting it to work

      I now regret giving up on strawberry Perl because I thought the problem was with it.

      Also beyond the context of this thread, worth mentioning is this thread: http://www.perlmonks.org/?node_id=890830
      Great tips/solutions for ActivePerl on 64-bit Windows and how to get cpan working on it.