Loading ...
Sorry, an error occurred while loading the content.

Re: utperl

Expand Messages
  • jrb32002
    ... cases in ... Hmm, that seems like an awful lot of trouble to go through to avoid using Test::Unit. Here s my normal template for a Perl module. Copy it
    Message 1 of 5 , Jul 26, 2002
    • 0 Attachment
      --- In extremeprogramming@y..., "JohnA" <john.mlist1@a...> wrote:
      > Here's a ut driver for perl. It uses "reflection" to discover test
      cases in
      > the current script and then invokes them.

      Hmm, that seems like an awful lot of trouble to go through to avoid
      using Test::Unit. Here's my normal template for a Perl module. Copy
      it as something else (eg foo.pm) and replace the two instances
      of "template" with "foo". Execute directly like a script to run the
      unit tests. My scripts are tending more and more to have nothing in
      them except 'use' lines and one line handing the command line
      arguments to a 'main' subroutine in some module ....

      ---- template.pm
      #!/usr/bin/perl
      package template;
      if ( $0 =~ m|/template.pm$| ) {
      eval 'use Test::Unit';
      create_suite();
      run_suite();
      }

      ##================================================================

      ## @@@@ Code here, as mix of test and normal subroutines

      ##----------------------------------------------------------------

      ## @@@@ Code here, as mix of test and normal subroutines


      ##================================================================
      1;
      ----
    Your message has been successfully submitted and would be delivered to recipients shortly.