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


Test-Perl-Metrics-Simple documentation  | view source Contained in the Test-Perl-Metrics-Simple distribution.

Index


NAME

Top

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

SYNOPSIS

Top

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

Top

This is VERSION 0.1

DESCRIPTION

Top

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

FUNCTIONS

Top

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

Top

Seiki Koga <koga@shanon.co.jp>

SEE ALSO

Top

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

LICENSE

Top

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


Test-Perl-Metrics-Simple documentation  | view source Contained in the Test-Perl-Metrics-Simple distribution.