Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -3639,6 +3639,7 @@ dist/ExtUtils-ParseXS/t/lib/PrimitiveCapture.pm Primitive STDOUT/ERR capturing
dist/ExtUtils-ParseXS/t/lib/TypemapTest/Foo.pm ExtUtils::Typemaps tests
dist/ExtUtils-ParseXS/t/pseudotypemap1 A test-typemap
dist/ExtUtils-ParseXS/t/typemap Standard typemap for controlled testing
dist/ExtUtils-ParseXS/t/XSBroken.xs Test file for ExtUtils::ParseXS tests
dist/ExtUtils-ParseXS/t/XSInclude.xsh Test file for ExtUtils::ParseXS tests
dist/ExtUtils-ParseXS/t/XSMore.xs Test file for ExtUtils::ParseXS tests
dist/ExtUtils-ParseXS/t/XSTest.pm Test file for ExtUtils::ParseXS tests
Expand Down
6 changes: 3 additions & 3 deletions dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ EOF
#-Wall: if there is no $self->{Full_func_name} there are no xsubs in this .xs
#so 'file' is unused
print Q(<<"EOF") if $self->{Full_func_name};
##if PERL_VERSION_LT(5, 9, 0)
##if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */
# char* file = __FILE__;
##else
# const char* file = __FILE__;
Expand Down Expand Up @@ -955,7 +955,7 @@ EOF

print Q(<<"EOF") if ($self->{Overload});
# /* register the overloading (type 'A') magic */
##if PERL_VERSION_LT(5, 9, 0)
##if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */
# PL_amagic_generation++;
##endif
# /* The magic for overload gets a GV* via gv_fetchmeth as */
Expand Down Expand Up @@ -1906,7 +1906,7 @@ sub generate_init {

my $inputmap = $typemaps->get_inputmap(xstype => $xstype);
if (not defined $inputmap) {
$self->blurt("Error: No INPUT definition for type '$type', typekind '" . $type->xstype . "' found");
$self->blurt("Error: No INPUT definition for type '$type', typekind '$xstype' found");
return;
}

Expand Down
14 changes: 13 additions & 1 deletion dist/ExtUtils-ParseXS/t/001-basic.t
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/perl

use strict;
use Test::More tests => 17;
use Test::More tests => 18;
use Config;
use DynaLoader;
use ExtUtils::CBuilder;
use lib (-d 't' ? File::Spec->catdir(qw(t lib)) : 'lib');
use PrimitiveCapture;

my ($source_file, $obj_file, $lib_file);

Expand Down Expand Up @@ -178,6 +180,16 @@ unless ($ENV{PERL_NO_CLEANUP}) {
}
#####################################################################

{ # third block: broken typemap
my $pxs = ExtUtils::ParseXS->new;
tie *FH, 'Foo';
my $stderr = PrimitiveCapture::capture_stderr(sub {
$pxs->process_file(filename => 'XSBroken.xs', output => \*FH);
});
like $stderr, '/No INPUT definition/', "Exercise typemap error";
}
#####################################################################

sub Foo::TIEHANDLE { bless {}, 'Foo' }
sub Foo::PRINT { shift->{buf} .= join '', @_ }
sub Foo::content { shift->{buf} }
26 changes: 26 additions & 0 deletions dist/ExtUtils-ParseXS/t/XSBroken.xs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

typedef IV MyType3;

MODULE = XSBroken PACKAGE = XSBroken

PROTOTYPES: ENABLE


TYPEMAP: <<'END'
MyType3 T_BAAR

OUTPUT
T_BAAR
sv_setiv($arg, (IV)$var);
END

MyType3
typemaptest3(foo)
MyType3 foo
CODE:
RETVAL = foo;
OUTPUT:
RETVAL