In an XSUB package, certain C routines that return "OK/not OK"
are provided with warning messages on the way out, like this:
int
mm_array_store(scalar, sv)
mm_scalar *scalar
SV *sv
POSTCALL:
if (!RETVAL && PL_dowarn) warn("mma_scalar_set: %s", mm_error
());
Test programs for this package, run under Test::More, try to prevent
such a warning from showing up in the test output: like this:
{ no warnings; local $^W = '';
ok (!mm_array_store ($array, MM_ARRAY_ELEMENTS, $longString),
"shouldn't be able to store a second long string");
}
Yet the warning message ends up in the test output, like this:
$ make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/0_passthrus....1/7 # max shared mem size on this platform is
67104744 (0x3FFEFE8)
t/0_passthrus....ok
t/1_scalars......1/21 # min shared mem size is 8192 (0x2000),
allocation unit is 8 bytes
t/1_scalars......ok
t/2_array........1/94 mm_array_store: mm:alloc: out of memory at t/
2_array.t line 171.
The last line is not good because it looks like an error to people,
even though it's a deliberately induced error for testing purposes.
I've looked through the Test::More manpage, but cannot find what else
I can do to suppress such error messages during testing.
Can you please help?
Thanks,
craig
www.animalhead.com