This is an automated email from the ASF dual-hosted git repository.

jking pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/thrift.git


The following commit(s) were added to refs/heads/master by this push:
     new bbc1377  THRIFT-4691: ensure CPAN module runs unit tests
bbc1377 is described below

commit bbc137787496154fb794b210ad783899f2d3092f
Author: James E. King III <jk...@apache.org>
AuthorDate: Mon Jan 14 12:07:10 2019 -0500

    THRIFT-4691: ensure CPAN module runs unit tests
---
 configure.ac                         |  2 +-
 lib/perl/MANIFEST.SKIP               |  5 +++--
 lib/perl/Makefile.PL                 | 13 +++++++++++++
 lib/perl/Makefile.am                 |  4 ++--
 lib/perl/build-cpan-dist.sh          |  5 ++++-
 lib/perl/{test => t}/Makefile.am     |  0
 lib/perl/{test => t}/memory_buffer.t |  0
 lib/perl/{test => t}/multiplex.t     |  0
 lib/perl/{test => t}/processor.t     |  0
 9 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index d229734..c5683ec 100755
--- a/configure.ac
+++ b/configure.ac
@@ -821,7 +821,7 @@ AC_CONFIG_FILES([
   lib/nodejs/Makefile
   lib/nodets/Makefile
   lib/perl/Makefile
-  lib/perl/test/Makefile
+  lib/perl/t/Makefile
   lib/php/Makefile
   lib/php/test/Makefile
   lib/dart/Makefile
diff --git a/lib/perl/MANIFEST.SKIP b/lib/perl/MANIFEST.SKIP
index 7963b42..9b04450 100644
--- a/lib/perl/MANIFEST.SKIP
+++ b/lib/perl/MANIFEST.SKIP
@@ -8,6 +8,7 @@ Makefile
 Makefile.am
 Makefile.in
 pm_to_blib
-test/Makefile.am
-test/Makefile.in
+t/Makefile
+t/Makefile.am
+t/Makefile.in
 tools/FixupDist.pl
diff --git a/lib/perl/Makefile.PL b/lib/perl/Makefile.PL
index bdeaad2..5e60ab4 100644
--- a/lib/perl/Makefile.PL
+++ b/lib/perl/Makefile.PL
@@ -33,4 +33,17 @@ WriteMakefile( ABSTRACT => 'Apache Thrift is a software 
framework for scalable c
                    'Bit::Vector'     => 0,
                    'Class::Accessor' => 0
                },
+#              SIGN => 1,
                VERSION_FROM => 'lib/Thrift.pm' );
+
+# THRIFT-4691
+package MY; # so that "SUPER" works right
+sub test {
+    # Adds gen-perl and gen-perl2 to the test execution as include paths
+    # Could not find anything in MakeMaker that would do this...
+    my @result;
+    for (@result = shift->SUPER::test(@_)) {
+        s/\$\(TEST_FILES\)/-Igen-perl -Igen-perl2 \$(TEST_FILES)/ig;
+    }
+    @result;
+}
diff --git a/lib/perl/Makefile.am b/lib/perl/Makefile.am
index fa0f16b..abae1e7 100644
--- a/lib/perl/Makefile.am
+++ b/lib/perl/Makefile.am
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-SUBDIRS = test
+SUBDIRS = t
 
 Makefile-perl.mk : Makefile.PL
        $(PERL) Makefile.PL MAKEFILE=Makefile-perl.mk 
INSTALLDIRS=$(INSTALLDIRS) INSTALL_BASE=$(PERL_PREFIX)
@@ -95,7 +95,7 @@ BUILT_SOURCES = $(PERL_GEN)
 
 check-local: $(PERL_GEN)
        $(PERL) -Iblib/lib -I@abs_srcdir@ -I@builddir@/gen-perl2 
-I@builddir@/gen-perl \
-               @abs_srcdir@/test.pl @abs_srcdir@/test/*.t
+               @abs_srcdir@/test.pl @abs_srcdir@/t/*.t
 
 $(THRIFTTEST_GEN): $(THRIFT_IF) $(THRIFT)
        $(THRIFT) --gen perl $<
diff --git a/lib/perl/build-cpan-dist.sh b/lib/perl/build-cpan-dist.sh
index ae22e7e..ac0ff0b 100755
--- a/lib/perl/build-cpan-dist.sh
+++ b/lib/perl/build-cpan-dist.sh
@@ -12,9 +12,10 @@ rm -rf Thrift-*
 
 # setup cpan without a prompt
 echo | cpan
-cpan install HTTP::Date
+cpan install HTTP::Date Log::Log4perl
 cpan install CPAN
 cpan install CPAN::Meta ExtUtils::MakeMaker JSON::PP
+# cpan install Module::Signature
 
 perl Makefile.PL
 rm MYMETA.yml
@@ -47,6 +48,8 @@ if [[ "$DISTDIR" != "$NEWDIR" ]]; then
 fi
 cd $DISTDIR
 cp -p ../Makefile.PL .
+cp -pr ../gen-perl .
+cp -pr ../gen-perl2 .
 perl ../tools/FixupDist.pl
 cd ..
 tar cvzf $DISTFILE $DISTDIR
diff --git a/lib/perl/test/Makefile.am b/lib/perl/t/Makefile.am
similarity index 100%
rename from lib/perl/test/Makefile.am
rename to lib/perl/t/Makefile.am
diff --git a/lib/perl/test/memory_buffer.t b/lib/perl/t/memory_buffer.t
similarity index 100%
rename from lib/perl/test/memory_buffer.t
rename to lib/perl/t/memory_buffer.t
diff --git a/lib/perl/test/multiplex.t b/lib/perl/t/multiplex.t
similarity index 100%
rename from lib/perl/test/multiplex.t
rename to lib/perl/t/multiplex.t
diff --git a/lib/perl/test/processor.t b/lib/perl/t/processor.t
similarity index 100%
rename from lib/perl/test/processor.t
rename to lib/perl/t/processor.t

Reply via email to