Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #9 #18

Merged
merged 1 commit into from
Dec 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/App/autotest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ sub changed_and_new_files {
sub run_tests {
my ($self, @tests)=@_;

my $result=$self->test_runner->run(@tests);
my @exist = grep { if(-e $_) { $_ } } @tests;

my $result=$self->test_runner->run(@exist);
$self->history->perpetuate($result);

if ($self->history->things_just_got_better) {
Expand Down
6 changes: 6 additions & 0 deletions t/unit/autotest.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use constant TEST_PROGRAMS_DIRECTORY => 'data/t';
use constant A_TEST_PROGRAM => 'data/t/1.t';
use constant ANOTHER_TEST_PROGRAM => 'data/t/2.t';
use constant SOME_TEST_PROGRAMS => [ A_TEST_PROGRAM, ANOTHER_TEST_PROGRAM ];
use constant NONEXISTENT_PROGRAM => 't/t/notthere.t';

use constant AN_AFTER_CHANGE_OR_NEW_HOOK_THAT_EXISTS_IMMEDIATELY => sub { 1 };

Expand Down Expand Up @@ -72,6 +73,11 @@ describe 'an autotest' => sub {
my $result=$autotest->all_test_programs;
eq_or_diff( [sort @$result], [sort @list] );
};

it 'should not fail for nonexistent test' => sub {
my $autotest = an_autotest();
$autotest->run_tests([NONEXISTENT_PROGRAM]);
};
};

describe 'changed_and_new_files' => sub {
Expand Down