Update upstream source from tag 'upstream/0.043'
Update to upstream version '0.043'
with Debian dir 6b01c5597fdc6efd80e6e41dd057f61303b8b3ef
gregor herrmann
1 year, 19 days ago
0 | 0 | use 5.006; |
1 | 1 | use lib 'lib'; |
2 | 2 | use Module::Build::Tiny; |
3 | Build_PL(@ARGV); | |
3 | Build_PL(\@ARGV, \%ENV); |
0 | 0 | Revision history for Module::Build::Tiny |
1 | ||
2 | 0.043 2023-04-19 02:05:14+02:00 Europe/Amsterdam | |
3 | - Fix manification test for perls without man paths | |
4 | ||
5 | 0.042 2023-04-18 23:32:40+02:00 Europe/Amsterdam | |
6 | - Restore manpage generation | |
7 | - Add include/ to include paths | |
8 | - Compile all .c files in src/ | |
9 | ||
10 | 0.041 2023-04-17 16:03:06+02:00 Europe/Amsterdam | |
11 | - Released without changes from 0.040 | |
12 | ||
13 | 0.040 2023-02-05 23:06:28+01:00 Europe/Amsterdam (TRIAL RELEASE) | |
14 | - Manify .pod after .pm | |
15 | - Filter out script documentation from scripts | |
16 | - Don't manify podless modules/scripts | |
1 | 17 | |
2 | 18 | 0.039 2014-10-12 10:38:39+02:00 Europe/Amsterdam |
3 | 19 | Supply basename to *.PL files as its args |
0 | ||
1 | 0 | This is the Perl distribution Module-Build-Tiny. |
2 | 1 | |
3 | 2 | Installing Module-Build-Tiny is straightforward. |
8 | 7 | |
9 | 8 | % cpanm Module::Build::Tiny |
10 | 9 | |
11 | If you are installing into a system-wide directory, you may need to pass the | |
12 | "-S" flag to cpanm, which uses sudo to install the module: | |
13 | ||
14 | % cpanm -S Module::Build::Tiny | |
10 | If it does not have permission to install modules to the current perl, cpanm | |
11 | will automatically set up and install to a local::lib in your home directory. | |
12 | See the local::lib documentation (https://metacpan.org/pod/local::lib) for | |
13 | details on enabling it in your environment. | |
15 | 14 | |
16 | 15 | ## Installing with the CPAN shell |
17 | 16 | |
21 | 20 | |
22 | 21 | ## Manual installation |
23 | 22 | |
24 | As a last resort, you can manually install it. Download the tarball, untar it, | |
25 | then build it: | |
23 | As a last resort, you can manually install it. If you have not already | |
24 | downloaded the release tarball, you can find the download link on the module's | |
25 | MetaCPAN page: https://metacpan.org/pod/Module::Build::Tiny | |
26 | ||
27 | Untar the tarball, install configure prerequisites (see below), then build it: | |
26 | 28 | |
27 | 29 | % perl Build.PL |
28 | 30 | % ./Build && ./Build test |
31 | 33 | |
32 | 34 | % ./Build install |
33 | 35 | |
34 | If you are installing into a system-wide directory, you may need to run: | |
36 | Or the more portable variation: | |
35 | 37 | |
36 | % sudo ./Build install | |
38 | % perl Build.PL | |
39 | % perl Build | |
40 | % perl Build test | |
41 | % perl Build install | |
42 | ||
43 | If your perl is system-managed, you can create a local::lib in your home | |
44 | directory to install modules to. For details, see the local::lib documentation: | |
45 | https://metacpan.org/pod/local::lib | |
46 | ||
47 | The prerequisites of this distribution will also have to be installed manually. The | |
48 | prerequisites are listed in one of the files: `MYMETA.yml` or `MYMETA.json` generated | |
49 | by running the manual build process described above. | |
50 | ||
51 | ## Configure Prerequisites | |
52 | ||
53 | This distribution requires other modules to be installed before this | |
54 | distribution's installer can be run. They can be found under the | |
55 | "configure_requires" key of META.yml or the | |
56 | "{prereqs}{configure}{requires}" key of META.json. | |
57 | ||
58 | ## Other Prerequisites | |
59 | ||
60 | This distribution may require additional modules to be installed after running | |
61 | Build.PL. | |
62 | Look for prerequisites in the following phases: | |
63 | ||
64 | * to run ./Build, PHASE = build | |
65 | * to use the module code itself, PHASE = runtime | |
66 | * to run tests, PHASE = test | |
67 | ||
68 | They can all be found in the "PHASE_requires" key of MYMETA.yml or the | |
69 | "{prereqs}{PHASE}{requires}" key of MYMETA.json. | |
37 | 70 | |
38 | 71 | ## Documentation |
39 | 72 | |
40 | 73 | Module-Build-Tiny documentation is available as POD. |
41 | You can run perldoc from a shell to read the documentation: | |
74 | You can run `perldoc` from a shell to read the documentation: | |
42 | 75 | |
43 | 76 | % perldoc Module::Build::Tiny |
77 | ||
78 | For more information on installing Perl modules via CPAN, please see: | |
79 | https://www.cpan.org/modules/INSTALL.html |
291 | 291 | |
292 | 292 | - "Package" refers to the collection of files distributed by the Copyright |
293 | 293 | Holder, and derivatives of that collection of files created through |
294 | textual modification. | |
294 | textual modification. | |
295 | 295 | - "Standard Version" refers to such a Package if it has not been modified, |
296 | 296 | or has been modified in accordance with the wishes of the Copyright |
297 | Holder. | |
297 | Holder. | |
298 | 298 | - "Copyright Holder" is whoever is named in the copyright or copyrights for |
299 | the package. | |
299 | the package. | |
300 | 300 | - "You" is you, if you're thinking about copying or distributing this Package. |
301 | 301 | - "Reasonable copying fee" is whatever you can justify on the basis of media |
302 | 302 | cost, duplication charges, time of people involved, and so on. (You will |
303 | 303 | not be required to justify it to the Copyright Holder, but only to the |
304 | computing community at large as a market that must bear the fee.) | |
304 | computing community at large as a market that must bear the fee.) | |
305 | 305 | - "Freely Available" means that no fee is charged for the item itself, though |
306 | 306 | there may be fees involved in handling the item. It also means that |
307 | 307 | recipients of the item may redistribute it under the same conditions they |
308 | received it. | |
308 | received it. | |
309 | 309 | |
310 | 310 | 1. You may make and give away verbatim copies of the source form of the |
311 | 311 | Standard Version of this Package without restriction, provided that you |
372 | 372 | |
373 | 373 | 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
374 | 374 | WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
375 | MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
375 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
376 | 376 | |
377 | 377 | The End |
378 | 378 |
0 | # This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.020. | |
0 | # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.029. | |
1 | 1 | Build.PL |
2 | 2 | Changes |
3 | 3 | INSTALL |
9 | 9 | Todo |
10 | 10 | dist.ini |
11 | 11 | lib/Module/Build/Tiny.pm |
12 | t/00-compile.t | |
13 | 12 | t/lib/DistGen.pm |
14 | t/release-pod-syntax.t | |
15 | 13 | t/simple.t |
14 | xt/author/pod-syntax.t |
4 | 4 | "David Golden <dagolden@cpan.org>" |
5 | 5 | ], |
6 | 6 | "dynamic_config" : 0, |
7 | "generated_by" : "Dist::Zilla version 5.020, CPAN::Meta::Converter version 2.142060", | |
7 | "generated_by" : "Dist::Zilla version 6.029, CPAN::Meta::Converter version 2.150010", | |
8 | 8 | "license" : [ |
9 | 9 | "perl_5" |
10 | 10 | ], |
11 | 11 | "meta-spec" : { |
12 | 12 | "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", |
13 | "version" : "2" | |
13 | "version" : 2 | |
14 | 14 | }, |
15 | 15 | "name" : "Module-Build-Tiny", |
16 | 16 | "prereqs" : { |
40 | 40 | }, |
41 | 41 | "develop" : { |
42 | 42 | "requires" : { |
43 | "Test::More" : "0", | |
43 | 44 | "Test::Pod" : "1.41" |
44 | 45 | } |
45 | 46 | }, |
81 | 82 | "File::Spec" : "0", |
82 | 83 | "File::Temp" : "0", |
83 | 84 | "IO::File" : "0", |
84 | "IO::Handle" : "0", | |
85 | 85 | "IPC::Open2" : "0", |
86 | "IPC::Open3" : "0", | |
87 | 86 | "Test::More" : "0.88", |
88 | 87 | "XSLoader" : "0", |
89 | 88 | "blib" : "0", |
98 | 97 | "provides" : { |
99 | 98 | "Module::Build::Tiny" : { |
100 | 99 | "file" : "lib/Module/Build/Tiny.pm", |
101 | "version" : "0.039" | |
100 | "version" : "0.043" | |
102 | 101 | } |
103 | 102 | }, |
104 | 103 | "release_status" : "stable", |
105 | 104 | "resources" : { |
106 | 105 | "bugtracker" : { |
107 | "mailto" : "bug-module-build-tiny at rt.cpan.org", | |
108 | "web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=Module-Build-Tiny" | |
106 | "web" : "https://github.com/Perl-Toolchain-Gang/module-build-tiny/issues" | |
109 | 107 | }, |
110 | 108 | "repository" : { |
111 | 109 | "type" : "git", |
112 | "url" : "git://github.com/Leont/module-build-tiny.git", | |
113 | "web" : "https://github.com/Leont/module-build-tiny" | |
110 | "url" : "git://github.com/Perl-Toolchain-Gang/module-build-tiny.git", | |
111 | "web" : "https://github.com/Perl-Toolchain-Gang/module-build-tiny" | |
114 | 112 | } |
115 | 113 | }, |
116 | "version" : "0.039" | |
114 | "version" : "0.043", | |
115 | "x_generated_by_perl" : "v5.36.0", | |
116 | "x_serialization_backend" : "Cpanel::JSON::XS version 4.29", | |
117 | "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later" | |
117 | 118 | } |
118 | 119 |
9 | 9 | File::Spec: '0' |
10 | 10 | File::Temp: '0' |
11 | 11 | IO::File: '0' |
12 | IO::Handle: '0' | |
13 | 12 | IPC::Open2: '0' |
14 | IPC::Open3: '0' | |
15 | 13 | Test::More: '0.88' |
16 | 14 | XSLoader: '0' |
17 | 15 | blib: '0' |
41 | 39 | conflicts: |
42 | 40 | local::lib: '< 1.006008' |
43 | 41 | dynamic_config: 0 |
44 | generated_by: 'Dist::Zilla version 5.020, CPAN::Meta::Converter version 2.142060' | |
42 | generated_by: 'Dist::Zilla version 6.029, CPAN::Meta::Converter version 2.150010' | |
45 | 43 | license: perl |
46 | 44 | meta-spec: |
47 | 45 | url: http://module-build.sourceforge.net/META-spec-v1.4.html |
50 | 48 | provides: |
51 | 49 | Module::Build::Tiny: |
52 | 50 | file: lib/Module/Build/Tiny.pm |
53 | version: '0.039' | |
51 | version: '0.043' | |
54 | 52 | requires: |
55 | 53 | CPAN::Meta: '0' |
56 | 54 | DynaLoader: '0' |
73 | 71 | strict: '0' |
74 | 72 | warnings: '0' |
75 | 73 | resources: |
76 | bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Module-Build-Tiny | |
77 | repository: git://github.com/Leont/module-build-tiny.git | |
78 | version: '0.039' | |
74 | bugtracker: https://github.com/Perl-Toolchain-Gang/module-build-tiny/issues | |
75 | repository: git://github.com/Perl-Toolchain-Gang/module-build-tiny.git | |
76 | version: '0.043' | |
77 | x_generated_by_perl: v5.36.0 | |
78 | x_serialization_backend: 'YAML::Tiny version 1.73' | |
79 | x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' |
0 | ||
1 | ||
2 | 0 | This archive contains the distribution Module-Build-Tiny, |
3 | version 0.039: | |
1 | version 0.043: | |
4 | 2 | |
5 | 3 | A tiny replacement for Module::Build |
6 | 4 | |
10 | 8 | the same terms as the Perl 5 programming language system itself. |
11 | 9 | |
12 | 10 | |
13 | This README file was generated by Dist::Zilla::Plugin::Readme v5.020. | |
14 | ||
11 | This README file was generated by Dist::Zilla::Plugin::Readme v6.029. |
4 | 4 | copyright_holder = Leon Timmermans, David Golden |
5 | 5 | copyright_year = 2011 |
6 | 6 | |
7 | ;Building | |
8 | [@LEONT] | |
9 | ; List explicitely for 'dzil authodeps' | |
10 | ;authordep Dist::Zilla::Plugin::BuildSelf | |
11 | install_tool = self | |
12 | BuildSelf.auto_configure_requires = 1 | |
13 | AutoPrereqs.skip = File::ShareDir | |
14 | -remove = PodCoverageTests | |
7 | [Git::GatherDir] | |
8 | [PruneCruft] | |
9 | [MetaYAML] | |
10 | [License] | |
11 | [Manifest] | |
12 | [Readme] | |
13 | ||
14 | [AutoPrereqs] | |
15 | skip = File::ShareDir | |
16 | [MetaJSON] | |
17 | [GitHub::Meta] | |
18 | [Git::NextVersion] | |
19 | [MetaProvides::Package] | |
20 | ||
21 | [BuildSelf] | |
22 | auto_configure_requires = 1 | |
23 | ||
24 | [PodSyntaxTests] | |
25 | ||
26 | [InstallGuide] | |
27 | [PodWeaver] | |
28 | [PkgVersion] | |
29 | [NextRelease] | |
30 | ||
31 | [CheckChangesHasContent] | |
32 | [Git::Check] | |
33 | [RunExtraTests] | |
34 | [TestRelease] | |
35 | [ConfirmRelease] | |
36 | ||
37 | [MinimumPerl] | |
38 | ||
39 | [UploadToCPAN] | |
40 | ||
41 | [Git::Commit] | |
42 | [Git::Tag] | |
43 | [Git::Push] | |
44 | ||
15 | 45 | [Prereqs / RuntimeSuggests] |
16 | 46 | constant = 1.27 |
17 | 47 | [Prereqs / RuntimeConflicts] |
18 | 48 | local::lib = <1.006008 |
19 | 49 | [Prereqs / TestSuggests] |
20 | 50 | File::ShareDir = 1.000 |
51 | ||
52 | [OnlyCorePrereqs] | |
53 | :version = 0.012 | |
54 | check_dual_life_versions = 0 | |
55 | skip = ExtUtils::Config | |
56 | skip = ExtUtils::Helpers | |
57 | skip = ExtUtils::InstallPaths |
0 | 0 | package Module::Build::Tiny; |
1 | $Module::Build::Tiny::VERSION = '0.039'; | |
1 | $Module::Build::Tiny::VERSION = '0.043'; | |
2 | 2 | use strict; |
3 | 3 | use warnings; |
4 | 4 | use Exporter 5.57 'import'; |
22 | 22 | print $fh $content; |
23 | 23 | } |
24 | 24 | sub read_file { |
25 | my ($filename, $mode) = @_; | |
25 | my ($filename) = @_; | |
26 | 26 | open my $fh, '<', $filename or die "Could not open $filename: $!\n"; |
27 | 27 | return do { local $/; <$fh> }; |
28 | 28 | } |
60 | 60 | my $version = $options->{meta}->version; |
61 | 61 | require ExtUtils::CBuilder; |
62 | 62 | my $builder = ExtUtils::CBuilder->new(config => $options->{config}->values_set); |
63 | my $ob_file = $builder->compile(source => $c_file, defines => { VERSION => qq/"$version"/, XS_VERSION => qq/"$version"/ }, include_dirs => [ curdir, dirname($source) ]); | |
63 | my @objects = $builder->compile(source => $c_file, defines => { VERSION => qq/"$version"/, XS_VERSION => qq/"$version"/ }, include_dirs => [ curdir, 'include', dirname($source) ]); | |
64 | ||
65 | my $o = $options->{config}->get('_o'); | |
66 | for my $c_source (find(qr/\.c$/, 'src')) { | |
67 | my $o_file = catfile($tempdir, basename($c_source, '.c') . $o); | |
68 | push @objects, $builder->compile(source => $c_file, include_dirs => [ curdir, 'include', dirname($source) ]) | |
69 | } | |
64 | 70 | |
65 | 71 | require DynaLoader; |
66 | 72 | my $mod2fname = defined &DynaLoader::mod2fname ? \&DynaLoader::mod2fname : sub { return $_[0][-1] }; |
67 | 73 | |
68 | 74 | mkpath($archdir, $options->{verbose}, oct '755') unless -d $archdir; |
69 | 75 | my $lib_file = catfile($archdir, $mod2fname->(\@parts) . '.' . $options->{config}->get('dlext')); |
70 | return $builder->link(objects => $ob_file, lib_file => $lib_file, module_name => join '::', @parts); | |
76 | return $builder->link(objects => \@objects, lib_file => $lib_file, module_name => join '::', @parts); | |
71 | 77 | } |
72 | 78 | |
73 | 79 | sub find { |
77 | 83 | return @ret; |
78 | 84 | } |
79 | 85 | |
86 | sub contains_pod { | |
87 | my ($file) = @_; | |
88 | return unless -T $file; | |
89 | return read_file($file) =~ /^\=(?:head|pod|item)/m; | |
90 | } | |
91 | ||
80 | 92 | my %actions = ( |
81 | 93 | build => sub { |
82 | 94 | my %opt = @_; |
83 | 95 | for my $pl_file (find(qr/\.PL$/, 'lib')) { |
84 | (my $pm = $pl_file) =~ s/\.PL$//; | |
96 | (my $pm = $pl_file) =~ s/\.PL$//; | |
85 | 97 | system $^X, $pl_file, $pm and die "$pl_file returned $?\n"; |
86 | 98 | } |
87 | my %modules = map { $_ => catfile('blib', $_) } find(qr/\.p(?:m|od)$/, 'lib'); | |
99 | my %modules = map { $_ => catfile('blib', $_) } find(qr/\.pm$/, 'lib'); | |
100 | my %docs = map { $_ => catfile('blib', $_) } find(qr/\.pod$/, 'lib'); | |
88 | 101 | my %scripts = map { $_ => catfile('blib', $_) } find(qr//, 'script'); |
102 | my %sdocs = map { $_ => delete $scripts{$_} } grep { /.pod$/ } keys %scripts; | |
89 | 103 | my %shared = map { $_ => catfile(qw/blib lib auto share dist/, $opt{meta}->name, abs2rel($_, 'share')) } find(qr//, 'share'); |
90 | pm_to_blib({ %modules, %scripts, %shared }, catdir(qw/blib lib auto/)); | |
104 | pm_to_blib({ %modules, %docs, %scripts, %shared }, catdir(qw/blib lib auto/)); | |
91 | 105 | make_executable($_) for values %scripts; |
92 | 106 | mkpath(catdir(qw/blib arch/), $opt{verbose}); |
93 | 107 | process_xs($_, \%opt) for find(qr/.xs$/, 'lib'); |
94 | 108 | |
95 | 109 | if ($opt{install_paths}->install_destination('bindoc') && $opt{install_paths}->is_default_installable('bindoc')) { |
96 | manify($_, catfile('blib', 'bindoc', man1_pagename($_)), $opt{config}->get('man1ext'), \%opt) for keys %scripts; | |
110 | my $section = $opt{config}->get('man1ext'); | |
111 | for my $input (keys %scripts, keys %sdocs) { | |
112 | next unless contains_pod($input); | |
113 | my $output = catfile('blib', 'bindoc', man1_pagename($input)); | |
114 | manify($input, $output, $section, \%opt); | |
115 | } | |
97 | 116 | } |
98 | 117 | if ($opt{install_paths}->install_destination('libdoc') && $opt{install_paths}->is_default_installable('libdoc')) { |
99 | manify($_, catfile('blib', 'libdoc', man3_pagename($_)), $opt{config}->get('man3ext'), \%opt) for keys %modules; | |
118 | my $section = $opt{config}->get('man3ext'); | |
119 | for my $input (keys %modules, keys %docs) { | |
120 | next unless contains_pod($input); | |
121 | my $output = catfile('blib', 'libdoc', man3_pagename($input)); | |
122 | manify($input, $output, $section, \%opt); | |
123 | } | |
100 | 124 | } |
125 | return 0; | |
101 | 126 | }, |
102 | 127 | test => sub { |
103 | 128 | my %opt = @_; |
110 | 135 | lib => [ map { rel2abs(catdir(qw/blib/, $_)) } qw/arch lib/ ], |
111 | 136 | ); |
112 | 137 | my $tester = TAP::Harness::Env->create(\%test_args); |
113 | $tester->runtests(sort +find(qr/\.t$/, 't'))->has_errors and exit 1; | |
138 | return $tester->runtests(sort +find(qr/\.t$/, 't'))->has_errors; | |
114 | 139 | }, |
115 | 140 | install => sub { |
116 | 141 | my %opt = @_; |
117 | 142 | die "Must run `./Build build` first\n" if not -d 'blib'; |
118 | 143 | install($opt{install_paths}->install_map, @opt{qw/verbose dry_run uninst/}); |
144 | return 0; | |
119 | 145 | }, |
120 | 146 | clean => sub { |
121 | 147 | my %opt = @_; |
122 | 148 | rmtree($_, $opt{verbose}) for qw/blib temp/; |
149 | return 0; | |
123 | 150 | }, |
124 | 151 | realclean => sub { |
125 | 152 | my %opt = @_; |
126 | 153 | rmtree($_, $opt{verbose}) for qw/blib temp Build _build_params MYMETA.yml MYMETA.json/; |
154 | return 0; | |
127 | 155 | }, |
128 | 156 | ); |
129 | 157 | |
135 | 163 | GetOptionsFromArray($_, \%opt, qw/install_base=s install_path=s% installdirs=s destdir=s prefix=s config=s% uninst:1 verbose:1 dry_run:1 pureperl-only:1 create_packlist=i jobs=i/) for ($env, $bargv, \@ARGV); |
136 | 164 | $_ = detildefy($_) for grep { defined } @opt{qw/install_base destdir prefix/}, values %{ $opt{install_path} }; |
137 | 165 | @opt{ 'config', 'meta' } = (ExtUtils::Config->new($opt{config}), get_meta()); |
138 | $actions{$action}->(%opt, install_paths => ExtUtils::InstallPaths->new(%opt, dist_name => $opt{meta}->name)); | |
166 | exit $actions{$action}->(%opt, install_paths => ExtUtils::InstallPaths->new(%opt, dist_name => $opt{meta}->name)); | |
139 | 167 | } |
140 | 168 | |
141 | 169 | sub Build_PL { |
154 | 182 | #ABSTRACT: A tiny replacement for Module::Build |
155 | 183 | |
156 | 184 | |
157 | # vi:et:sts=2:sw=2:ts=2 | |
185 | # vi:noet:sts=4:sw=4:ts=4 | |
158 | 186 | |
159 | 187 | __END__ |
160 | 188 | |
168 | 196 | |
169 | 197 | =head1 VERSION |
170 | 198 | |
171 | version 0.039 | |
199 | version 0.043 | |
172 | 200 | |
173 | 201 | =head1 SYNOPSIS |
174 | 202 | |
183 | 211 | This module provides a simple, lightweight, drop-in replacement. |
184 | 212 | |
185 | 213 | Whereas Module::Build has over 6,700 lines of code; this module has less |
186 | than 120, yet supports the features needed by most distributions. | |
214 | than 200, yet supports the features needed by most distributions. | |
187 | 215 | |
188 | 216 | =head2 Supported |
189 | 217 | |
219 | 247 | |
220 | 248 | =head2 Directory structure |
221 | 249 | |
222 | Your .pm and .pod files must be in F<lib/>. Any executables must be in | |
250 | Your .pm, .xs and .pod files must be in F<lib/>. Any executables must be in | |
223 | 251 | F<script/>. Test files must be in F<t/>. Dist sharedirs must be in F<share/>. |
224 | 252 | |
225 | 253 | =head1 USAGE |
0 | use 5.006; | |
1 | use strict; | |
2 | use warnings; | |
3 | ||
4 | # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.040 | |
5 | ||
6 | use Test::More tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0); | |
7 | ||
8 | ||
9 | ||
10 | my @module_files = ( | |
11 | 'Module/Build/Tiny.pm' | |
12 | ); | |
13 | ||
14 | ||
15 | ||
16 | # no fake home requested | |
17 | ||
18 | my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib'; | |
19 | ||
20 | use File::Spec; | |
21 | use IPC::Open3; | |
22 | use IO::Handle; | |
23 | ||
24 | open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; | |
25 | ||
26 | my @warnings; | |
27 | for my $lib (@module_files) | |
28 | { | |
29 | # see L<perlfaq8/How can I capture STDERR from an external command?> | |
30 | my $stderr = IO::Handle->new; | |
31 | ||
32 | my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]"); | |
33 | binmode $stderr, ':crlf' if $^O eq 'MSWin32'; | |
34 | my @_warnings = <$stderr>; | |
35 | waitpid($pid, 0); | |
36 | is($?, 0, "$lib loaded ok"); | |
37 | ||
38 | if (@_warnings) | |
39 | { | |
40 | warn @_warnings; | |
41 | push @warnings, @_warnings; | |
42 | } | |
43 | } | |
44 | ||
45 | ||
46 | ||
47 | is(scalar(@warnings), 0, 'no warnings found') if $ENV{AUTHOR_TESTING}; | |
48 | ||
49 |
0 | #!perl | |
1 | ||
2 | BEGIN { | |
3 | unless ($ENV{RELEASE_TESTING}) { | |
4 | require Test::More; | |
5 | Test::More::plan(skip_all => 'these tests are for release candidate testing'); | |
6 | } | |
7 | } | |
8 | ||
9 | # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. | |
10 | use Test::More; | |
11 | use Test::Pod 1.41; | |
12 | ||
13 | all_pod_files_ok(); |
22 | 22 | $dist->add_file('script/simple', undent(<<' ---')); |
23 | 23 | #!perl |
24 | 24 | use Foo::Bar; |
25 | print Simple->VERSION . "\n"; | |
25 | print Foo::Bar->VERSION . "\n"; | |
26 | 26 | --- |
27 | 27 | my $has_compiler = ExtUtils::CBuilder->new->have_compiler(); |
28 | $dist->add_file('lib/Simple.xs', undent(<<' ---')) if $has_compiler; | |
28 | $dist->add_file('lib/Foo/Bar.xs', undent(<<' ---')) if $has_compiler; | |
29 | 29 | #define PERL_NO_GET_CONTEXT |
30 | 30 | #include "EXTERN.h" |
31 | 31 | #include "perl.h" |
32 | 32 | #include "XSUB.h" |
33 | 33 | |
34 | MODULE = Simple PACKAGE = Simple | |
34 | MODULE = Foo::Bar PACKAGE = Foo::Bar | |
35 | 35 | |
36 | 36 | const char* |
37 | 37 | foo() |
118 | 118 | ok( -f catfile(qw/blib lib auto share dist Foo-Bar file.txt/), 'sharedir file has been made'); |
119 | 119 | |
120 | 120 | if ($has_compiler) { |
121 | XSLoader::load('Simple'); | |
122 | is(Simple::foo(), "Hello World!\n", 'Can run XSub Simple::foo'); | |
121 | XSLoader::load('Foo::Bar'); | |
122 | is(Foo::Bar::foo(), "Hello World!\n", 'Can run XSub Foo::Bar::foo'); | |
123 | } | |
124 | ||
125 | SKIP: { | |
126 | require ExtUtils::InstallPaths; | |
127 | skip 1, 'No manification supported' if not ExtUtils::InstallPaths->new->is_default_installable('libdoc'); | |
128 | require ExtUtils::Helpers; | |
129 | my $file = "blib/libdoc/" . ExtUtils::Helpers::man3_pagename($pmfile, '.'); | |
130 | ok( -e $file, 'Module gets manified properly'); | |
123 | 131 | } |
124 | 132 | } |
125 | 133 |