819d24
From 8855ef2b482c09da9255079b0fac92d08c8308fb Mon Sep 17 00:00:00 2001
819d24
From: Olly Betts <olly@survex.com>
819d24
Date: Tue, 13 Jun 2017 17:32:37 +1200
819d24
Subject: [PATCH] [Perl] Fix testsuite to work without . in @INC
819d24
819d24
"." was removed from @INC in Perl 5.26 for security reasons, and has
819d24
also been removed from older versions in some distros.
819d24
819d24
Fixes https://github.com/swig/swig/issues/997 reported by lfam.
819d24
---
819d24
 CHANGES.current                            | 6 ++++++
819d24
 Examples/Makefile.in                       | 2 +-
819d24
 Examples/test-suite/perl5/run-perl-test.pl | 2 +-
819d24
 3 files changed, 8 insertions(+), 2 deletions(-)
819d24
819d24
#diff --git a/CHANGES.current b/CHANGES.current
819d24
#index ac620c9..6b379a9 100644
819d24
#--- a/CHANGES.current
819d24
#+++ b/CHANGES.current
819d24
#@@ -7,6 +7,12 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
819d24
# Version 4.0.0 (in progress)
819d24
# ===========================
819d24
# 
819d24
#+2017-06-13: olly
819d24
#+	    [Perl] Fix testsuite to work without . in @INC - it was removed in
819d24
#+	    Perl 5.26 for security reasons, and has also been removed from
819d24
#+	    older versions in some distros.  Fixes
819d24
#+	    https://github.com/swig/swig/issues/997 reported by lfam.
819d24
#+
819d24
# 2017-06-03: wsfulton
819d24
#             Fix %import on a file containing a file scope %fragment forced inclusion to not
819d24
#             generate the fragment contents as %import should not result in code being generated.
819d24
diff --git a/Examples/Makefile.in b/Examples/Makefile.in
819d24
index 7682b56..8a88fb5 100644
819d24
--- a/Examples/Makefile.in
819d24
+++ b/Examples/Makefile.in
819d24
@@ -282,7 +282,7 @@ perl5_static_cpp: $(SRCDIR_SRCS)
819d24
 # -----------------------------------------------------------------
819d24
 
819d24
 perl5_run:
819d24
-	$(RUNTOOL) $(PERL) $(PERL5_SCRIPT) $(RUNPIPE)
819d24
+	$(RUNTOOL) $(PERL) -I. $(PERL5_SCRIPT) $(RUNPIPE)
819d24
 
819d24
 # -----------------------------------------------------------------
819d24
 # Version display
819d24
diff --git a/Examples/test-suite/perl5/run-perl-test.pl b/Examples/test-suite/perl5/run-perl-test.pl
819d24
index 106bf00..5ea4e511 100644
819d24
--- a/Examples/test-suite/perl5/run-perl-test.pl
819d24
+++ b/Examples/test-suite/perl5/run-perl-test.pl
819d24
@@ -7,7 +7,7 @@ use strict;
819d24
 
819d24
 my $command = shift @ARGV;
819d24
 
819d24
-my $output = `$^X $command 2>&1;;
819d24
+my $output = `$^X -I. $command 2>&1;;
819d24
 
819d24
 die "SWIG Perl test failed: \n\n$output\n"
819d24
   if $?;
819d24
-- 
819d24
2.9.4
819d24