File tree Expand file tree Collapse file tree 7 files changed +84
-0
lines changed
test-data/module-build_module Expand file tree Collapse file tree 7 files changed +84
-0
lines changed Original file line number Diff line number Diff line change 11/t /test-data /dzil_module /build_dir
2+ /t /test-data /module-build_module /_build
3+ /t /test-data /module-build_module /build_dir
4+ /t /test-data /module-build_module /MANIFEST *
5+ /t /test-data /module-build_module /Build
6+
Original file line number Diff line number Diff line change @@ -15,6 +15,17 @@ elif [[ -e minil.toml ]]; then
1515 # shellcheck disable=SC2012
1616 DIR=$( ls -td -- * / | head -n 1 | cut -d' /' -f1)
1717 mv " $DIR " build_dir
18+ elif [[ -e Build.PL ]]; then
19+ rm -rf " $BUILD_DIR "
20+ perl Build.PL
21+ ./Build clean
22+ ./Build manifest
23+ ./Build distdir
24+
25+ # Module::Build does not support a build directory, so we have to find
26+ # the last created dir and use that.
27+ DIR=" $( perl -MModule::Build -e' print Module::Build->resume->dist_dir;' ) "
28+ mv " $DIR " $BUILD_DIR
1829fi
1930
2031exit 0
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bats
2+
3+ PATH=" $PATH :../../../bin"
4+
5+ setup () {
6+ cd t/test-data/module-build_module
7+ }
8+
9+ @test " Build.PL cpan-install-dist-deps" {
10+ run cpan-install-build-deps
11+ [ " $status " -eq 0 ]
12+ }
13+
14+ @test " Build.PL build-dist" {
15+ run build-dist
16+ [ " $status " -eq 0 ]
17+ }
18+
19+ @test " Build.PL test-dist" {
20+ run cd build_dir && test-dist
21+ [ " $status " -eq 0 ]
22+ }
23+
24+ @test " Build.PL auto-build-and-test-dist" {
25+ GITHUB_ACTIONS=${GITHUB_ACTIONS:= ' ' }
26+ if [[ $GITHUB_ACTIONS = true ]]; then
27+ skip " Tricky to test under CI"
28+ fi
29+ run rm -rf build_dir && bash auto-build-and-test-dist && rm -rf build_dir
30+ [ " $status " -eq 0 ]
31+ }
Original file line number Diff line number Diff line change 1+ use Module::Build;
2+ Module::Build-> new(
3+ module_name => ' Acme::Helpers' ,
4+ license => ' perl' ,
5+ )-> create_build_script;
Original file line number Diff line number Diff line change 1+ package Acme::Helpers ;
2+
3+ use strict;
4+ use warnings;
5+
6+ our $VERSION = ' 0.01' ;
7+
8+ sub true {
9+ return 1;
10+ }
11+
12+ 1;
13+
14+ # ABSTRACT: turns baubles into trinkets
Original file line number Diff line number Diff line change 1+ use strict;
2+ use warnings;
3+
4+ use Test::More;
5+
6+ use Acme::Helpers ();
7+ ok( Acme::Helpers::true() );
8+
9+ done_testing();
Original file line number Diff line number Diff line change 1+ use strict;
2+ use warnings;
3+
4+ use Test::More;
5+
6+ use Acme::Helpers ();
7+ ok( Acme::Helpers::true() );
8+
9+ done_testing();
You can’t perform that action at this time.
0 commit comments