Skip to content

Commit

Permalink
added experimental --verbose flag to test command
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 27, 2011
1 parent eb41277 commit 6b04c9c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,5 +1,8 @@
This file documents the revision history for Perl extension Mojolicious.

2.14 2011-10-28 00:00:00
- Added EXPERIMENTAL --verbose flag to test command.

2.13 2011-10-28 00:00:00
- Removed experimental status from many classes, methods, attributes
and functions.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -35,7 +35,7 @@ has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };

our $CODENAME = 'Leaf Fluttering In Wind';
our $VERSION = '2.13';
our $VERSION = '2.14';

# "These old doomsday devices are dangerously unstable.
# I'll rest easier not knowing where they are."
Expand Down
17 changes: 13 additions & 4 deletions lib/Mojolicious/Command/test.pm
Expand Up @@ -4,19 +4,27 @@ use Mojo::Base 'Mojo::Command';
use Cwd;
use FindBin;
use File::Spec;
use Test::Harness;
use Getopt::Long 'GetOptions';

has description => <<'EOF';
Run unit tests.
EOF
has usage => <<"EOF";
usage: $0 test [TESTS]
usage: $0 test [OPTIONS] [TESTS]
These options are available:
--verbose Print verbose debug information to STDERR.
EOF

# "Why, the secret ingredient was...water!
# Yes, ordinary water, laced with nothing more than a few spoonfuls of LSD."
sub run {
my ($self, @tests) = @_;
my $self = shift;

# Options
local @ARGV = @_;
GetOptions(verbose => sub { $ENV{HARNESS_VERBOSE} = 1 });
my @tests = @ARGV;

# Search tests
unless (@tests) {
Expand Down Expand Up @@ -54,7 +62,8 @@ sub run {
}

# Run tests
runtests(sort @tests);
require Test::Harness;
Test::Harness::runtests(sort @tests);
}

1;
Expand Down

0 comments on commit 6b04c9c

Please sign in to comment.