Skip to content

Instantly share code, notes, and snippets.

@dams
Created November 25, 2009 16:27
Show Gist options
  • Save dams/242842 to your computer and use it in GitHub Desktop.
Save dams/242842 to your computer and use it in GitHub Desktop.
sub do_tests {
my $self = shift;
my $tests = $self->find_test_files;
if(@$tests) {
my $args = $self->tap_harness_args;
if($self->use_tap_harness or ($args and %$args)) {
$self->run_tap_harness($tests);
}
else {
$self->run_test_harness($tests);
}
}
else {
$self->log_info("No tests defined.\n");
}
$self->run_visual_script;
}
sub run_tap_harness {
my ($self, $tests) = @_;
require TAP::Harness;
# TODO allow the test @INC to be set via our API?
TAP::Harness->new({
lib => [@INC],
verbosity => $self->{properties}{verbose},
switches => [ $self->harness_switches ],
%{ $self->tap_harness_args },
})->runtests(@$tests);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment