Ticket #2116: nci-errors.patch

File nci-errors.patch, 2.1 KB (added by ligne, 4 years ago)

fix NCI errors, including those affecting the PCRE tests.

  • t/library/nciutils.t

    diff --git a/t/library/nciutils.t b/t/library/nciutils.t
    index f456394..0cad0e9 100644
    a b  
    1515 
    1616=cut 
    1717 
     18.include 'iglobals.pasm' 
     19 
    1820.sub 'main' :main 
    1921    load_bytecode 'Test/More.pbc' 
    2022 
    2123    .local pmc exports, curr_namespace, test_namespace 
    2224    curr_namespace = get_namespace 
    2325    test_namespace = get_namespace ['Test';'More'] 
    24     exports        = split ' ', 'plan diag ok nok is todo' 
     26    exports        = split ' ', 'plan diag ok nok is todo skip_all' 
    2527    test_namespace.'export_to'(curr_namespace, exports) 
    2628 
     29    $P0 = getinterp 
     30    $P1 = $P0[.IGLOBALS_CONFIG_HASH] 
     31    $I1 = $P1['HAS_EXTRA_NCI_THUNKS'] 
     32    if $I1 == 1 goto have_enough_nci 
     33    $I1 = $P1['HAS_LIBFFI'] 
     34    if $I1 == 1 goto have_enough_nci 
     35 
     36    skip_all('No NCI thunks') 
     37    exit 0 
     38 
     39  have_enough_nci: 
    2740    ##  set our plan 
    2841    plan(13) 
    2942 
  • t/library/pcre.t

    diff --git a/t/library/pcre.t b/t/library/pcre.t
    index 928bd0b..28cccf7 100644
    a b  
    77 
    88use Test::More; 
    99use Parrot::Test tests => 2; 
     10use Parrot::Config qw(%PConfig); 
    1011 
    1112=head1 NAME 
    1213 
     
    4445    skip( 'no pcre-config', Test::Builder->new()->expected_tests() ) 
    4546        unless $has_pcre; 
    4647 
     48    unless ($PConfig{HAS_EXTRA_NCI_THUNKS} || $PConfig{HAS_LIBFFI}) { 
     49        skip( 'Parrot built without libffi or extra NCI thunks', 
     50              Test::Builder->new()->expected_tests() ); 
     51    } 
     52 
    4753## 1 
    4854## Check that the library can be loaded and initialized, 
    4955## diganose the failure otherwise. 
  • t/pmc/nci.t

    diff --git a/t/pmc/nci.t b/t/pmc/nci.t
    index 6a0a8f1..3c3932d 100644
    a b  
    3232$ENV{TEST_PROG_ARGS} ||= ''; 
    3333 
    3434SKIP: { 
     35    unless ($PConfig{HAS_EXTRA_NCI_THUNKS} || $PConfig{HAS_LIBFFI}) { 
     36        plan skip_all => "Parrot built without libffi or extra NCI thunks"; 
     37    } 
    3538    unless ( -e "runtime/parrot/dynext/libnci_test$PConfig{load_ext}" ) { 
    3639        plan skip_all => "Please make libnci_test$PConfig{load_ext}"; 
    3740    }