Subject: | t/xml.t is patched, but tests failed |
Hello,
I patched the file xml.t, but the tests failed:
------------------------------------------------------------------------
w1:/tmp/Log-Log4perl-Layout-XMLLayout-0.03# make test
PERL_DL_NONLAZY=1 /opt/perl510/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/pod-coverage.t .. ok
t/pod.t ........... ok
t/xml.t ........... 1/?
# Failed test at t/xml.t line 50.
#
# Failed test at t/xml.t line 73.
# Failed test at t/xml.t line 93.
# Failed test at t/xml.t line 113.
# Looks like you failed 4 tests of 11.
t/xml.t ........... Dubious, test returned 4 (wstat 1024, 0x400)
Failed 4/11 subtests
Test Summary Report
-------------------
t/xml.t (Wstat: 1024 Tests: 11 Failed: 4)
Failed tests: 8-11
Non-zero exit status: 4
Files=3, Tests=13, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.23 cusr
0.03 csys = 0.28 CPU)
Result: FAIL
Failed 1/3 test programs. 4/13 subtests failed.
make: *** [test_dynamic] Fehler 4
------------------------------------------------------------------------
The information about os, perlversion, and patched xml.t, please see the
attachments.
Subject: | uname |
Message body not shown because it is not plain text.
Subject: | perlversion |
Message body not shown because it is not plain text.
Subject: | xml.t |
###########################################
# Test Suite for Log::Log4perl::Layout::XMLLayout
# Guido Carls
###########################################
use warnings;
use strict;
use Test::More qw(no_plan);
BEGIN {
use_ok(q(Log::Log4perl));
use_ok(q(Log::Log4perl::Layout));
use_ok(q(Log::Log4perl::Layout::XMLLayout));
use_ok(q(Log::Log4perl::Level));
use_ok(q(Log::Log4perl::Appender::TestBuffer));
use_ok(q(File::Spec));
}
my $app = Log::Log4perl::Appender->new(
"Log::Log4perl::Appender::TestBuffer");
ok(1); # If we made it this far, we're ok.
my $logger = Log::Log4perl->get_logger("abc.def.ghi");
$logger->add_appender($app);
#########################################################
# Log with LocationInfo
#########################################################
my $layout = Log::Log4perl::Layout::XMLLayout->new(
{ LocationInfo => { value => 'TRUE' },
Encoding => { value => 'iso8859-1'}});
$app->layout($layout);
$logger->debug("That's the message");
my($regexp)= qr(<\?xml version = "1.0" encoding = "iso8859-1"\?>$
<log4j:event logger="abc.def.ghi"$
\ttimestamp="[0-9]+"$
\tlevel="DEBUG"$
\tthread="[0-9]+">$
\t<log4j:message><!\[CDATA\[That's the message\]\]></log4j:message>$
\t<log4j:NDC><!\[CDATA\[undef\]\]></log4j:NDC>$
\t<log4j:locationInfo class="main"$
\t\tmethod="main"$
\t\tfile="t/xml.t"$
\t\tline="[0-9]+">$
\t</log4j:locationInfo>$
</log4j:event>$)m;
ok($app->buffer() =~ m/$regexp/) || diag($app->buffer());
#########################################################
# Log with LocationInfo and without Encoding
#########################################################
$layout = Log::Log4perl::Layout::XMLLayout->new(
{ LocationInfo => { value => 'TRUE' } });
$app->layout($layout);
$logger->debug("That's the message");
$regexp= qr(<log4j:event logger="abc.def.ghi"$
\ttimestamp="[0-9]+"$
\tlevel="DEBUG"$
\tthread="[0-9]+">$
\t<log4j:message><!\[CDATA\[That's the message\]\]></log4j:message>$
\t<log4j:NDC><!\[CDATA\[undef\]\]></log4j:NDC>$
\t<log4j:locationInfo class="main"$
\t\tmethod="main"$
\t\tfile="t/xml.t"$
\t\tline="[0-9]+">$
\t</log4j:locationInfo>$
</log4j:event>$)m;
ok($app->buffer() =~ m/$regexp/);
############################################################
# Log without LocationInfo
############################################################
$app->buffer("");
$layout = Log::Log4perl::Layout::XMLLayout->new(
{ LocationInfo => { value => 'FALSE' },
Encoding => { value => 'iso8859-1'}});
$app->layout($layout);
$logger->debug("That's the message");
$regexp= qr(<\?xml version = "1.0" encoding = "iso8859-1"\?>$
<log4j:event logger="abc.def.ghi"$
\ttimestamp="[0-9]+"$
\tlevel="DEBUG"$
\tthread="[0-9]+">$
\t<log4j:message><!\[CDATA\[That's the message\]\]></log4j:message>$
\t<log4j:NDC><!\[CDATA\[undef\]\]></log4j:NDC>$
</log4j:event>$)m;
ok($app->buffer() =~ m/$regexp/);
############################################################
# Log without Encoding and without LocationInfo
############################################################
$app->buffer("");
$layout = Log::Log4perl::Layout::XMLLayout->new(
{ LocationInfo => { value => 'FALSE' } });
$app->layout($layout);
$logger->debug("That's the message");
$regexp= qr(<log4j:event logger="abc.def.ghi"$
\ttimestamp="[0-9]+"$
\tlevel="DEBUG"$
\tthread="[0-9]+">$
\t<log4j:message><!\[CDATA\[That's the message\]\]></log4j:message>$
\t<log4j:NDC><!\[CDATA\[undef\]\]></log4j:NDC>$
</log4j:event>$)m;
ok($app->buffer() =~ m/$regexp/);
##############################################################
#
# run POD Tests
#
##############################################################