This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
parts/apicheck.pl: Extract list into lib fcn call
authorKarl Williamson <khw@cpan.org>
Sun, 28 Jul 2019 19:43:16 +0000 (13:43 -0600)
committerNicolas R <atoomic@cpan.org>
Fri, 27 Sep 2019 22:51:27 +0000 (16:51 -0600)
This is in preparation for scanprov to use the same list.

(cherry picked from commit b3b8255b1cb743f160e6d9f33fa52b7b7149d53b)
Signed-off-by: Nicolas R <atoomic@cpan.org>
dist/Devel-PPPort/parts/apicheck.pl
dist/Devel-PPPort/parts/ppptools.pl

index 1e4dee5..f51bb11 100644 (file)
@@ -137,28 +137,9 @@ my %stack = (
    pMY_CXT     => [ @my_cxt_prereqs ],
 );
 
-# Things to not try to check.  Either not applicable, or too hard to get to
-# work here.
-my %ignore = (
-  map { ($_ => 1) } qw(
-    CLASS
-    dXSI32
-    items
-    ix
-    RETVAL
-    StructCopy
-    svtype
-    THIS
-    XopDISABLE
-    XopENABLE
-    XopENTRY
-    XopENTRYCUSTOM
-    XopENTRY_set
-    XS
-    XS_EXTERNAL
-    XS_INTERNAL
-  ),
-);
+
+# Things to not try to check.
+my %ignore = map { ("$_" => 1) } keys %{&known_but_hard_to_test_for()};
 
 # XXX The NEED_foo lines should be autogenerated
 print OUT <<HEAD;
index b3a0bcc..94ad122 100644 (file)
@@ -399,6 +399,41 @@ sub parse_embed
   return @func;
 }
 
+sub known_but_hard_to_test_for
+{
+    # This returns a list of functions/symbols that are in Perl, but the tests
+    # for their existence don't work, usually as a result of them being XS,
+    # and using XS to test.  Effectively, any XS code that compiles and works
+    # is exercising most of these XS-related ones.
+    #
+    # The values for the keys are each the version that ppport.h makes them
+    # work on, and were gleaned by manually looking at the code parts/inc/*.
+    # For non-ppport.h, scanprov will automatically figure out the version
+    # they were introduced in.
+
+    my %return;
+
+    for (qw(CLASS dXSI32 items ix pTHX_ RETVAL StructCopy svtype
+            STMT_START STMT_END STR_WITH_LEN THIS XS))
+    {
+        # __MIN_PERL__ is this at the time of this commit.  This is the
+        # earliest these have been tested to at the time of the commit, but
+        # likely go back further.
+        $return{$_} = '5.003_07';
+    }
+    for (qw(_pMY_CXT pMY_CXT_)) {
+        $return{$_} = '5.9.0';
+    }
+    for (qw(XopDISABLE XopENABLE XopENTRY XopENTRYCUSTOM XopENTRY_set)) {
+        $return{$_} = '5.13.7';
+    }
+    for (qw(XS_EXTERNAL XS_INTERNAL)) {
+        $return{$_} = '5.15.2';
+    }
+
+    return \%return;
+}
+
 sub normalize_prototype  # So that they can be compared more easily
 {
     my $proto = shift;