From f6db508c3a3e235e965596e7ffa572be87a5f433 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Tue, 9 Jul 2019 21:53:12 -0600 Subject: [PATCH] HACKERS: Update (cherry picked from commit ac27a862173e52405c4f93657cd350ad9312ec24) Signed-off-by: Nicolas R --- dist/Devel-PPPort/HACKERS | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/dist/Devel-PPPort/HACKERS b/dist/Devel-PPPort/HACKERS index 07289c5..8cc8c24 100644 --- a/dist/Devel-PPPort/HACKERS +++ b/dist/Devel-PPPort/HACKERS @@ -32,6 +32,8 @@ It can currently build the following Perl releases: 5.8.x 5.9.x 5.1x.x + 5.2x.x + 5.3x.x =head2 Fully automatic API checks @@ -165,6 +167,9 @@ use the information in F to generate the main module F, the XS code in F and various test files in F. +You can get extra information from F by setting the environment +variable C to 1 or 2. + All of these files could be generated on the fly while building C, but not having the tests in F will confuse TEST/harness in the core. Not having F will be bad for @@ -220,19 +225,39 @@ of F to see where the code ends up. =item * The tests in the C<=tests> section. Remember not to use any fancy -modules or syntax elements, as the test code should be able to run -with Perl 5.003, which, for example, doesn't support C in -C-loops: +modules or syntax elements, as the test code needs to be able to run +with Perl 5.003. (This is because Devel::PPPort itself will run all test files +in the process of generating the information about when a feature came into +existence.) This means, for example + +=over + +=item C isn't supported in C-loops for my $x (1, 2, 3) { } # won't work with 5.003 +Instead declare C<$x> just before the statement + +=item The postfix for statement modifier isn't supported + + foo for 1..2 + +won't compile. Instead enclose C in a loop. + +=item You can't use plain C + +Instead, wrap it in a string eval C, and be sure it's skipped at +execution time on perls earlier than 5.005 + +=back + You can use C to report success or failure: - ok($got == 42); - ok($got, $expected); + ok($got, $expected, 'name'); + ok($got == 42); # Doesn't give good runtime diagnostics -Regular expressions are not supported as the second argument to C, -because older perls do not support the C operator. + ok($got, eval "qr/foo/", 'name') # But don't execute this statement + # on perls earlier than 5.005 =back @@ -270,7 +295,7 @@ Some C scripts would report a warning when there is defined a macro which is not part of Perl public API, except those macros which start with the C prefix. -Version checking can be tricky if you want to do it correct. +Version checking can be tricky to get correct. You can use #if { VERSION < 5.9.3 } -- 1.8.3.1