develooper Front page | perl.qa | Postings from December 2008

Module::Install and Test::NoWarnings- "require Test::NoWarnigs" should not hide warnings.

Thread Next
From:
Gabor Szabo
Date:
December 23, 2008 03:29
Subject:
Module::Install and Test::NoWarnings- "require Test::NoWarnigs" should not hide warnings.
Message ID:
d8a74af10812230329r5a3ef4f0g2d27b012b92c0289@mail.gmail.com
In the Padre project we encountered some strange behavior.
We recently switched to use Module::Install and we also use Test:::NoWarnings
in our tests.

It seems Module::Install loads all the modules listed as "requires" or
"test_requires"
during the execution of Makefile.PL


This brought up the question what happens when Test::NoWarnings is
"require"-d and
not "use"-d. As I can see from the code, the import() call is what
generated the
additional test in the END block. So that part behaves nicely.
On the other hand Test:::NoWarnings still hides all the warnings in such case.
Specifically it hides the warnings Makefile.PL generates when some of
the modules
are missing or are at a version lower than required.

So I think - besides the fact that M::I probably should not load the
required modules
to memory - "require Test::NoWarnigs" should not hide warnings.


As a workaround now, I added the following lines to the beginning of
our Makefile.PL

eval  {
	require Test::NoWarnings;
	$SIG{__WARN__} = 'DEFAULT';
};



regards
   Gabor

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About