test_warnings: new perl module recipe

This commit is contained in:
Joachim Mairböck
2024-10-26 18:25:13 +02:00
parent 2a8e5a5d38
commit 3c96f5b316

View File

@@ -0,0 +1,57 @@
SUMMARY="Test for warnings and the lack of them"
DESCRIPTION="If you've ever tried to use Test::NoWarnings to confirm there are no warnings \
generated by your tests, combined with the convenience of done_testing to not have to declare a \
test count, you'll have discovered that these two features do not play well together, as the test \
count will be calculated before the warnings test is run, resulting in a TAP error. (See \
examples/test_nowarnings.pl in this distribution for a demonstration.)
This module is intended to be used as a drop-in replacement for Test::NoWarnings: it also adds an \
extra test, but runs this test before done_testing calculates the test count, rather than after. \
It does this by hooking into done_testing as well as via an END block. You can declare a plan, or \
not, and things will still Just Work."
HOMEPAGE="https://metacpan.org/pod/Test::Warnings"
COPYRIGHT="2013 by Karen Etheridge"
LICENSE="Artistic"
REVISION="1"
SOURCE_URI="https://cpan.metacpan.org/authors/id/E/ET/ETHER/Test-Warnings-$portVersion.tar.gz"
CHECKSUM_SHA256="b9c375719f2c61c5f97aa5ee6cf4c901a972347c415969379b0b51f67c48bbcb"
SOURCE_DIR="Test-Warnings-$portVersion"
ARCHITECTURES="any"
PROVIDES="
test_warnings = $portVersion
"
REQUIRES="
haiku
vendor_perl
"
BUILD_REQUIRES="
haiku_devel
"
BUILD_PREREQUIRES="
cmd:make
cmd:perl
"
BUILD()
{
perl Makefile.PL PREFIX=$prefix
make
}
INSTALL()
{
make pure_install
# remove architecture-specific files
cd $prefix
rm -r $(perl -V:vendorarch | cut -d\' -f2 | cut -d/ -f5-)
# cut extracts the quoted string and strips the prefix (which is perl's and not ours)
}
TEST()
{
make test
}