Brad Bishop | 6f8dcde | 2018-10-16 10:47:12 +0800 | [diff] [blame] | 1 | From ba6733216202523a95b0b7ee2e534b8e30b6d7df Mon Sep 17 00:00:00 2001 |
| 2 | From: Dominic Hargreaves <dom@earth.li> |
| 3 | Date: Sat, 14 Oct 2017 16:27:53 +0200 |
| 4 | Subject: [PATCH] Skip various tests if PERL_BUILD_PACKAGING is set |
| 5 | |
| 6 | These are tests which tend not to be useful for downstream packagers |
| 7 | |
| 8 | t/porting/customized.t change originally from Todd Rinaldo |
| 9 | |
| 10 | Upstream-Status: Backport[https://perl5.git.perl.org/perl.git/ba6733216202523a95b0b7ee2e534b8e30b6d7df] |
| 11 | |
| 12 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> |
| 13 | --- |
| 14 | INSTALL | 3 ++- |
| 15 | MANIFEST | 1 + |
| 16 | PACKAGING | 30 ++++++++++++++++++++++++++++++ |
| 17 | regen/lib_cleanup.pl | 5 +++++ |
| 18 | t/porting/customized.t | 1 + |
| 19 | t/test.pl | 3 +++ |
| 20 | 6 files changed, 42 insertions(+), 1 deletion(-) |
| 21 | create mode 100644 PACKAGING |
| 22 | |
| 23 | diff --git a/INSTALL b/INSTALL |
| 24 | index 636f4bd52f..1285fc69a2 100644 |
| 25 | --- a/INSTALL |
| 26 | +++ b/INSTALL |
| 27 | @@ -2714,4 +2714,5 @@ This document is part of the Perl package and may be distributed under |
| 28 | the same terms as perl itself, with the following additional request: |
| 29 | If you are distributing a modified version of perl (perhaps as part of |
| 30 | a larger package) please B<do> modify these installation instructions |
| 31 | -and the contact information to match your distribution. |
| 32 | +and the contact information to match your distribution. Additional |
| 33 | +information for packagers is in F<PACKAGING>. |
| 34 | diff --git a/MANIFEST b/MANIFEST |
| 35 | index b3207030a9..32de824ca1 100644 |
| 36 | --- a/MANIFEST |
| 37 | +++ b/MANIFEST |
| 38 | @@ -4932,6 +4932,7 @@ os2/perlrexx.c Support perl interpreter embedded in REXX |
| 39 | os2/perlrexx.cmd Test perl interpreter embedded in REXX |
| 40 | overload.h generated overload enum (public) |
| 41 | overload.inc generated overload name table (implementation) |
| 42 | +PACKAGING notes and best practice for packaging perl 5 |
| 43 | packsizetables.inc The generated packprops array used in pp_pack.c |
| 44 | pad.c Scratchpad functions |
| 45 | pad.h Scratchpad headers |
| 46 | diff --git a/PACKAGING b/PACKAGING |
| 47 | new file mode 100644 |
| 48 | index 0000000000..0c69b87ba6 |
| 49 | --- /dev/null |
| 50 | +++ b/PACKAGING |
| 51 | @@ -0,0 +1,30 @@ |
| 52 | +If you read this file _as_is_, just ignore the funny characters you |
| 53 | +see. It is written in the POD format (see pod/perlpod.pod) which is |
| 54 | +specifically designed to be readable as is. |
| 55 | + |
| 56 | +=head1 NAME |
| 57 | + |
| 58 | +PACKAGING - notes and best practice for packaging perl 5 |
| 59 | + |
| 60 | +=head1 SYNOPSIS |
| 61 | + |
| 62 | +This document is aimed at anyone who is producing their own version of |
| 63 | +perl for distribution to other users. It is intended as a collection |
| 64 | +of useful tips, advice and best practice, rather than being a complete |
| 65 | +packaging manual. The starting point for installing perl remains |
| 66 | +F<INSTALL>. |
| 67 | + |
| 68 | +=head1 Customizing test running |
| 69 | + |
| 70 | +A small number of porting tests (those in t/porting) are not well suited |
| 71 | +to typical distribution packaging scenarios. For example, they assume |
| 72 | +they are working in a git clone of the upstream Perl repository, or |
| 73 | +enforce rules which are not relevant to downstream packagers. These can |
| 74 | +be skipped by setting the environment variable PERL_BUILD_PACKAGING. |
| 75 | +A complete list of tests which this applied to can be found by searching |
| 76 | +the codebase for this string. |
| 77 | + |
| 78 | +An alternative strategy would be to skip all porting tests, but many of |
| 79 | +them are useful if additional patches might be applied. |
| 80 | + |
| 81 | +=cut |
| 82 | diff --git a/regen/lib_cleanup.pl b/regen/lib_cleanup.pl |
| 83 | index 5e40b405a4..6caf74a563 100644 |
| 84 | --- a/regen/lib_cleanup.pl |
| 85 | +++ b/regen/lib_cleanup.pl |
| 86 | @@ -164,6 +164,11 @@ if ($TAP && !-d '.git' && !-f 'lib/.gitignore') { |
| 87 | exit 0; |
| 88 | } |
| 89 | |
| 90 | +if ($ENV{'PERL_BUILD_PACKAGING'}) { |
| 91 | + print "ok # skip explicitly disabled git tests by PERL_BUILD_PACKAGING\n"; |
| 92 | + exit 0; |
| 93 | +} |
| 94 | + |
| 95 | $fh = open_new('lib/.gitignore', '>', |
| 96 | { by => $0, |
| 97 | from => 'MANIFEST and parsing files in cpan/ dist/ and ext/'}); |
| 98 | diff --git a/t/porting/customized.t b/t/porting/customized.t |
| 99 | index 45fcafb100..5c3739198c 100644 |
| 100 | --- a/t/porting/customized.t |
| 101 | +++ b/t/porting/customized.t |
| 102 | @@ -13,6 +13,7 @@ BEGIN { |
| 103 | @INC = qw(lib Porting t); |
| 104 | require 'test.pl'; |
| 105 | skip_all("pre-computed SHA1 won't match under EBCDIC") if $::IS_EBCDIC; |
| 106 | + skip_all("This distro may have modified some files in cpan/. Skipping validation.") if $ENV{'PERL_BUILD_PACKAGING'}; |
| 107 | } |
| 108 | |
| 109 | use strict; |
| 110 | diff --git a/t/test.pl b/t/test.pl |
| 111 | index 79e6e25e95..1782dcf73c 100644 |
| 112 | --- a/t/test.pl |
| 113 | +++ b/t/test.pl |
| 114 | @@ -212,6 +212,9 @@ sub find_git_or_skip { |
| 115 | } else { |
| 116 | $reason = 'not being run from a git checkout'; |
| 117 | } |
| 118 | + if ($ENV{'PERL_BUILD_PACKAGING'}) { |
| 119 | + $reason = 'PERL_BUILD_PACKAGING is set'; |
| 120 | + } |
| 121 | skip_all($reason) if $_[0] && $_[0] eq 'all'; |
| 122 | skip($reason, @_); |
| 123 | } |
| 124 | -- |
| 125 | 2.17.1 |
| 126 | |