summaryrefslogtreecommitdiff
path: root/lib/perl
diff options
context:
space:
mode:
authorJames E. King III <jking@apache.org>2019-01-14 12:07:10 -0500
committerJames E. King III <jking@apache.org>2019-01-14 13:57:30 -0500
commitbbc137787496154fb794b210ad783899f2d3092f (patch)
treef6cf1df30fdd36aac1f9202425d17400a940d3ea /lib/perl
parentf61d9e52827ec14f35dde0f5c0740837a5572c83 (diff)
downloadthrift-bbc137787496154fb794b210ad783899f2d3092f.tar.gz
THRIFT-4691: ensure CPAN module runs unit tests
Diffstat (limited to 'lib/perl')
-rw-r--r--lib/perl/MANIFEST.SKIP5
-rw-r--r--lib/perl/Makefile.PL13
-rw-r--r--lib/perl/Makefile.am4
-rwxr-xr-xlib/perl/build-cpan-dist.sh5
-rw-r--r--lib/perl/t/Makefile.am (renamed from lib/perl/test/Makefile.am)0
-rw-r--r--lib/perl/t/memory_buffer.t (renamed from lib/perl/test/memory_buffer.t)0
-rw-r--r--lib/perl/t/multiplex.t (renamed from lib/perl/test/multiplex.t)0
-rw-r--r--lib/perl/t/processor.t (renamed from lib/perl/test/processor.t)0
8 files changed, 22 insertions, 5 deletions
diff --git a/lib/perl/MANIFEST.SKIP b/lib/perl/MANIFEST.SKIP
index 7963b42ad..9b044509e 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 bdeaad2b7..5e60ab40a 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 fa0f16b8a..abae1e77f 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 ae22e7e62..ac0ff0bc0 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
index de0397186..de0397186 100644
--- a/lib/perl/test/Makefile.am
+++ b/lib/perl/t/Makefile.am
diff --git a/lib/perl/test/memory_buffer.t b/lib/perl/t/memory_buffer.t
index 8fa9fd72e..8fa9fd72e 100644
--- a/lib/perl/test/memory_buffer.t
+++ b/lib/perl/t/memory_buffer.t
diff --git a/lib/perl/test/multiplex.t b/lib/perl/t/multiplex.t
index 90a9b4d02..90a9b4d02 100644
--- a/lib/perl/test/multiplex.t
+++ b/lib/perl/t/multiplex.t
diff --git a/lib/perl/test/processor.t b/lib/perl/t/processor.t
index f8330354f..f8330354f 100644
--- a/lib/perl/test/processor.t
+++ b/lib/perl/t/processor.t