How can I automatically run the Perl test suite when changing files?

Is there a tool that will monitor file changes in the Perl application directory tree and re-run the test package every time I save the changes to a module? Something similar to masaks tote .

+3
source share
7 answers

Win32::FileNotify can help track changes to the file system if you are on Windows.

+3
source

unix Makefile cron ( , ), , - .

, , ​​ svn, / .

, , script (, , /).

+3

, Smolder. , CI .

CI , ..

+2
+1

- , Perl.

sub run_tests {
    my $prove_out = `prove -lr`;
    my $tests_passed = $? == 0;

    return "" if $tests_passed;
    return $prove_out;
}

prove, Test:: Harness 3. . , .

+1

Test::Continuous Windows, script, :

use File::ChangeNotify;

$| = 1;

my $watcher = File::ChangeNotify->instantiate_watcher(
    directories => [ 't', 'lib' ],
    filter => qr/\.t|\.pl|\.pm/,
);

while (my @events = $watcher->wait_for_events) {
    print `prove -l -r -t --timer`;
}
0
source

Source: https://habr.com/ru/post/1723542/


All Articles