perl: Add basic test support

Signed-off-by: Marcel Denia <naoir@gmx.net>
This commit is contained in:
Marcel Denia
2014-08-20 00:31:31 +02:00
parent 008585be94
commit 95058be605
4 changed files with 106 additions and 1 deletions
+29 -1
View File
@@ -11,6 +11,9 @@ PERL_CMD:=$(STAGING_DIR_HOST)/usr/bin/perl5.20.0
# Module install prefix
PERL_SITELIB:=/usr/lib/perl5/5.20
PERL_TESTSDIR:=/usr/share/perl/perl-tests
PERLBASE_TESTSDIR:=/usr/share/perl/perlbase-tests
PERLMOD_TESTSDIR:=/usr/share/perl/perlmod-tests
define perlmod/host/relink
rm -f $(1)/Makefile.aperl
@@ -105,7 +108,7 @@ define perlmod/Compile
install
endef
define perlmod/Install
define perlmod/Install/NoStrip
$(INSTALL_DIR) $(strip $(1))$(PERL_SITELIB)
(cd $(PKG_INSTALL_DIR)$(PERL_SITELIB) && \
rsync --relative -rlHp --itemize-changes \
@@ -116,6 +119,11 @@ define perlmod/Install
$(strip $(2)) $(strip $(1))$(PERL_SITELIB))
chmod -R u+w $(strip $(1))$(PERL_SITELIB)
endef
define perlmod/Install
$(call perlmod/Install/NoStrip,$(1),$(2),$(3))
@echo "---> Stripping modules in: $(strip $(1))$(PERL_SITELIB)"
find $(strip $(1))$(PERL_SITELIB) -name \*.pm -or -name \*.pl | \
@@ -125,3 +133,23 @@ define perlmod/Install
-e '/^#$$$$/d' \
-e '/^#[^!"'"'"']/d'
endef
# You probably don't want to use this directly. Look at perlmod/InstallTests
define perlmod/_InstallTests
$(INSTALL_DIR) $(strip $(1))
(cd $(PKG_BUILD_DIR)/$(2) && \
rsync --relative -rlHp --itemize-changes \
--exclude=.packlist \
--prune-empty-dirs \
$(strip $(3)) $(strip $(1)))
chmod -R u+w $(strip $(1))
endef
define perlmod/InstallBaseTests
$(if $(CONFIG_PERL_TESTS),$(call perlmod/_InstallTests,$(1)$(PERL_TESTSDIR),,$(2)))
endef
define perlmod/InstallTests
$(if $(CONFIG_PERL_TESTS),$(call perlmod/_InstallTests,$(1)$(PERL_TESTSDIR),$(2),$(3)))
endef