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