Add basic perl repo test

This commit is contained in:
Ville Skyttä
2020-02-01 15:41:14 +02:00
parent aee7843bec
commit 1295364986
7 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
/MYMETA.json
/MYMETA.yml
/Makefile
/PreCommitHello-*.tar.*
/PreCommitHello-*/
/blib/
/pm_to_blib

View File

@@ -0,0 +1,5 @@
- id: perl-hook
name: perl example hook
entry: pre-commit-perl-hello
language: perl
files: ''

View File

@@ -0,0 +1,4 @@
MANIFEST
Makefile.PL
bin/pre-commit-perl-hello
lib/PreCommitHello.pm

View File

@@ -0,0 +1,10 @@
use strict;
use warnings;
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => "PreCommitHello",
VERSION_FROM => "lib/PreCommitHello.pm",
EXE_FILES => [qw(bin/pre-commit-perl-hello)],
);

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env perl
use strict;
use warnings;
use PreCommitHello;
PreCommitHello::hello();

View File

@@ -0,0 +1,12 @@
package PreCommitHello;
use strict;
use warnings;
our $VERSION = "0.1.0";
sub hello {
print "Hello from perl-commit Perl!\n";
}
1;

View File

@@ -876,3 +876,10 @@ def test_manifest_hooks(tempdir_factory, store):
types=['file'],
verbose=False,
)
def test_perl_hook(tempdir_factory, store):
_test_hook_repo(
tempdir_factory, store, 'perl_hooks_repo',
'perl-hook', [], b'Hello from perl-commit Perl!\n',
)