aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/perl/perl/fixes/packaging_test_skips.diff
blob: cf03dcf9893284e2bda6edbac2638dab80f4ec54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
From 41946a7ff425786d1ba38cbe0337e35bafb33a54 Mon Sep 17 00:00:00 2001
From: Dominic Hargreaves <dom@earth.li>
Date: Sat, 14 Oct 2017 16:27:53 +0200
Subject: Skip various tests if PERL_BUILD_PACKAGING is set

These are tests which tend not to be useful for downstream packagers

t/porting/customized.t change originally from Todd Rinaldo

Patch-Name: fixes/packaging_test_skips.diff
---
 INSTALL                |  3 ++-
 MANIFEST               |  1 +
 PACKAGING              | 30 ++++++++++++++++++++++++++++++
 regen/lib_cleanup.pl   |  5 +++++
 t/porting/customized.t |  1 +
 t/test.pl              |  3 +++
 6 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 PACKAGING

diff --git a/INSTALL b/INSTALL
index 0544b420ca..6af71dcdad 100644
--- a/INSTALL
+++ b/INSTALL
@@ -2724,4 +2724,5 @@ This document is part of the Perl package and may be distributed under
 the same terms as perl itself, with the following additional request:
 If you are distributing a modified version of perl (perhaps as part of
 a larger package) please B<do> modify these installation instructions
-and the contact information to match your distribution.
+and the contact information to match your distribution. Additional
+information for packagers is in F<PACKAGING>.
diff --git a/MANIFEST b/MANIFEST
index e102bf9277..37f901f4d8 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -4864,6 +4864,7 @@ os2/perlrexx.c			Support perl interpreter embedded in REXX
 os2/perlrexx.cmd		Test perl interpreter embedded in REXX
 overload.h			generated overload enum (public)
 overload.inc			generated overload name table (implementation)
+PACKAGING			notes and best practice for packaging perl 5
 packsizetables.inc		The generated packprops array used in pp_pack.c
 pad.c				Scratchpad functions
 pad.h				Scratchpad headers
diff --git a/PACKAGING b/PACKAGING
new file mode 100644
index 0000000000..6369f0b979
--- /dev/null
+++ b/PACKAGING
@@ -0,0 +1,30 @@
+If you read this file _as_is_, just ignore the funny characters you
+see.  It is written in the POD format (see pod/perlpod.pod) which is
+specifically designed to be readable as is.
+
+=head1 NAME
+
+PACKAGING - notes and best practice for packaging perl 5
+
+=head1 SYNOPSIS
+
+This document is aimed at anyone who is producing their own version of
+perl for distribution to other users. It is intended as a collection
+of useful tips, advice and best practice, rather than being a complete
+packaging manual. The starting point for installing perl remains
+F<INSTALL>.
+
+=head1 Customizing test running
+
+A small number of porting tests (those in t/porting) tests are not well
+suited to typical distribution packaging scenarios. For example, they
+assume they are working in a git clone of the upstream Perl repository,
+or enforce rules which are not relevant to downstream packagers.
+These can be skipped by setting the environment variable
+PERL_BUILD_PACKAGING. A complete list of tests which this applied to
+can be found by searching the codebase for this string.
+
+An alternative strategy would be to skip all porting tests, but many of
+them are useful if additional patches might be applied.
+
+=cut
diff --git a/regen/lib_cleanup.pl b/regen/lib_cleanup.pl
index 5e40b405a4..6caf74a563 100644
--- a/regen/lib_cleanup.pl
+++ b/regen/lib_cleanup.pl
@@ -164,6 +164,11 @@ if ($TAP && !-d '.git' && !-f 'lib/.gitignore') {
     exit 0;
 }
 
+if ($ENV{'PERL_BUILD_PACKAGING'}) {
+    print "ok # skip explicitly disabled git tests by PERL_BUILD_PACKAGING\n";
+    exit 0;
+}
+
 $fh = open_new('lib/.gitignore', '>',
                { by => $0,
                  from => 'MANIFEST and parsing files in cpan/ dist/ and ext/'});
diff --git a/t/porting/customized.t b/t/porting/customized.t
index 3bd6adb33a..fdaa3c4562 100644
--- a/t/porting/customized.t
+++ b/t/porting/customized.t
@@ -13,6 +13,7 @@ BEGIN {
     @INC = qw(lib Porting t);
     require 'test.pl';
     skip_all("pre-computed SHA1 won't match under EBCDIC") if $::IS_EBCDIC;
+    skip_all("This distro may have modified some files in cpan/. Skipping validation.") if $ENV{'PERL_BUILD_PACKAGING'};
 }
 
 use strict;
diff --git a/t/test.pl b/t/test.pl
index d86f6332b3..55ec664565 100644
--- a/t/test.pl
+++ b/t/test.pl
@@ -212,6 +212,9 @@ sub find_git_or_skip {
     } else {
 	$reason = 'not being run from a git checkout';
     }
+    if ($ENV{'PERL_BUILD_PACKAGING'}) {
+	$reason = 'PERL_BUILD_PACKAGING is set';
+    }
     skip_all($reason) if $_[0] && $_[0] eq 'all';
     skip($reason, @_);
 }