This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
start to make ext/B work with 5.14.x
authorDavid Mitchell <davem@iabyn.com>
Fri, 26 Oct 2012 09:14:06 +0000 (10:14 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 26 Oct 2012 15:51:56 +0000 (16:51 +0100)
This fixes up a couple of test files to work under 5.14.x.
Lots more needs fixing up to make the whole distribution work
under 5.14.x, but I've lost the will for now.,

ext/B/t/b.t
ext/B/t/concise-xs.t

index aad7f05..6912719 100644 (file)
@@ -272,7 +272,8 @@ is(B::opnumber("pp_null"), 0, "Testing opnumber with opname (pp_null)");
 
 is(B::class(bless {}, "Wibble::Bibble"), "Bibble", "Testing B::class()");
 is(B::cast_I32(3.14), 3, "Testing B::cast_I32()");
-is(B::opnumber("chop"), 39, "Testing opnumber with opname (chop)");
+is(B::opnumber("chop"), $] >= 5.015 ? 39 : 38,
+                           "Testing opnumber with opname (chop)");
 
 {
     no warnings 'once';
index b44cf49..4ababde 100644 (file)
@@ -127,8 +127,10 @@ my $testpkgs = {
     Digest::MD5 => { perl => [qw/ import /],
                     dflt => 'XS' },
 
-    Data::Dumper => { XS => [qw/ bootstrap Dumpxs _vstring /],
-                     constant => ['_bad_vsmg'],
+    Data::Dumper => { XS => [qw/ bootstrap Dumpxs /,
+                       $] >= 5.015 ? qw/_vstring / : () ],
+                   $] >= 5.015
+                       ?  (constant => ['_bad_vsmg']) : (),
                      dflt => 'perl' },
     B => { 
        dflt => 'constant',             # all but 47/297
@@ -156,7 +158,6 @@ my $testpkgs = {
 
        constant => [qw/ ASSIGN CVf_LVALUE
                     CVf_METHOD LIST_CONTEXT OP_CONST OP_LIST OP_RV2SV
-                    OP_GLOB
                     OP_STRINGIFY OPf_KIDS OPf_MOD OPf_REF OPf_SPECIAL
                     OPf_STACKED OPf_WANT OPf_WANT_LIST OPf_WANT_SCALAR
                     OPf_WANT_VOID OPpCONST_BARE OPpCONST_NOVER
@@ -166,12 +167,14 @@ my $testpkgs = {
                     OPpSORT_REVERSE OPpREVERSE_INPLACE OPpTARGET_MY
                     OPpTRANS_COMPLEMENT OPpTRANS_DELETE OPpTRANS_SQUASH
                     PMf_CONTINUE PMf_EVAL PMf_EXTENDED PMf_FOLD PMf_GLOBAL
-                    PMf_KEEP PMf_NONDESTRUCT PMf_SKIPWHITE RXf_PMf_CHARSET
-                    PMf_MULTILINE PMf_ONCE PMf_SINGLELINE RXf_PMf_KEEPCOPY
+                    PMf_KEEP PMf_NONDESTRUCT
+                    PMf_MULTILINE PMf_ONCE PMf_SINGLELINE
                     POSTFIX SVf_FAKE SVf_IOK SVf_NOK SVf_POK SVf_ROK
                     SVpad_OUR SVs_RMG SVs_SMG SWAP_CHILDREN OPpPAD_STATE
-                    OPpCONST_ARYBASE OPpEVAL_BYTES OPpSUBSTR_REPL_FIRST
-                    RXf_SKIPWHITE /,
+                    OPpCONST_ARYBASE RXf_SKIPWHITE/,
+                    $] >= 5.015 ? qw(
+                    OP_GLOB PMf_SKIPWHITE RXf_PMf_CHARSET RXf_PMf_KEEPCOPY
+                    OPpEVAL_BYTES OPpSUBSTR_REPL_FIRST) : (),
                    'CVf_LOCKED', # This ends up as a constant, pre or post 5.10
                    ],
                 },
@@ -187,8 +190,11 @@ my $testpkgs = {
                            WSTOPSIG WTERMSIG/,
                       'int_macro_int', # Removed in POSIX 1.16
                       ],
-              perl => [qw/ import load_imports croak usage printf sprintf
-                       perror AUTOLOAD /],
+              perl => [qw/ import croak AUTOLOAD /,
+                       $] >= 5.015
+                           ? qw/load_imports usage printf sprintf perror/
+                           : (),
+                       ],
 
               XS => [qw/ write wctomb wcstombs uname tzset tzname
                      ttyname tmpnam times tcsetpgrp tcsendbreak
@@ -205,8 +211,8 @@ my $testpkgs = {
                      fmod floor dup2 dup difftime cuserid ctime
                      ctermid cosh constant close clock ceil
                      bootstrap atan asin asctime acos access abort
-                     _exit sleep
-                     /],
+                     _exit
+                     /, $] >= 5.015 ? ('sleep') : () ],
               },
 
     IO::Socket => { dflt => 'constant',                # 157/190