Dist::Zilla::App::Command::test - test your dist


Dist-Zilla documentation Contained in the Dist-Zilla distribution.

Index


Code Index:

NAME

Top

Dist::Zilla::App::Command::test - test your dist

VERSION

Top

version 4.200008

SYNOPSIS

Top

  dzil test [ --release ] [ --no-author ] [ --automated ]

DESCRIPTION

Top

This command is a thin wrapper around the test method in Dist::Zilla. It builds your dist and runs the tests with the AUTHOR_TESTING environment variable turned on, so it's like doing this:

  export AUTHOR_TESTING=1
  dzil build --no-tgz
  cd $BUILD_DIRECTORY
  perl Makefile.PL
  make
  make test

A build that fails tests will be left behind for analysis, and dzil will exit a non-zero value. If the tests are successful, the build directory will be removed and dzil will exit with status 0.

OPTIONS

Top

--release

This will run the testsuite with RELEASE_TESTING=1

--automated

This will run the testsuite with AUTOMATED_TESTING=1

--no-author

This will run the testsuite without setting AUTHOR_TESTING

AUTHOR

Top

Ricardo SIGNES <rjbs@cpan.org>

COPYRIGHT AND LICENSE

Top


Dist-Zilla documentation Contained in the Dist-Zilla distribution.

use strict;
use warnings;
package Dist::Zilla::App::Command::test;
BEGIN {
  $Dist::Zilla::App::Command::test::VERSION = '4.200008';
}
# ABSTRACT: test your dist
use Dist::Zilla::App -command;


sub opt_spec {
  [ 'release'   => 'enables the RELEASE_TESTING env variable', { default => 0 } ],
  [ 'automated' => 'enables the AUTOMATED_TESTING env variable', { default => 0 } ],
  [ 'author!' => 'enables the AUTHOR_TESTING env variable (default behavior)', { default => 1 } ]
}


sub abstract { 'test your dist' }

sub execute {
  my ($self, $opt, $arg) = @_;

  local $ENV{RELEASE_TESTING} = 1 if $opt->release;
  local $ENV{AUTHOR_TESTING} = 1 if $opt->author;
  local $ENV{AUTOMATED_TESTING} = 1 if $opt->automated;

  $self->zilla->test;
}

1;

__END__