Seiki Koga > Test-Perl-Metrics-Simple > Test::Perl::Metrics::Simple

Download:
Test-Perl-Metrics-Simple-0.1.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
View/Report Bugs
Module Version: 0.1   Source  

NAME ^

Test::Perl::Metrics::Simple - Use Perl::Metrics::Simple in test programs

SYNOPSIS ^

Test one file:

  use Test::Perl::Metrics::Simple;
  use Test::More tests => 1;
  metrics_ok($file);

Or test all files in one or more directories:

  use Test::Perl::Metrics::Simple;
  all_metrics_ok($dir_1, $dir_2, $dir_N);

Or test all files in a distribution:

  use Test::Perl::Metrics::Simple;
  all_metrics_ok();

Recommended usage for CPAN distributions:

  use strict;
  use warnings;
  use File::Spec;
  use Test::More;

  if(not $ENV{'TEST_AUTHOR'}){
      my $msg = 'Author test.  Set $ENV{TEST_AUTHOR} to a true value to run.';
      plan(skip_all => $msg);
  }

  eval{require Test::Perl::Metrics::Simple;};

  if($@){
      my $msg = 'Test::Perl::Metrics::Simple required to criticise code';
      plan(skip_all => $msg);
  }

  Test::Perl::Metrics::Simple->import(-complexity => 30);
  all_metrics_ok();

VERSION ^

This is VERSION 0.1

DESCRIPTION ^

Test::Perl::Metrics::Simple is a module that tests Cyclomatic complexity of the code.

FUNCTIONS ^

import(%opt)

The value is set to Test::Perl::Metrics::Simple.

metrics_ok($file)

Cyclomatic complexity of the specified file is tested.

all_metrics_ok(@dirs)

Cyclomatic complexity of all the codes that exist in the specified directory is checked.

AUTHOR ^

Seiki Koga <koga@shanon.co.jp>

SEE ALSO ^

Perl::Metrics::Simple, Perl::Metrics, Test::More

LICENSE ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: