Skip Menu |

This queue is for tickets about the Test-Output CPAN distribution.

Report information
The Basics
Id: 85816
Status: rejected
Priority: 0/
Queue: Test-Output

People
Owner: Nobody in particular
Requestors: arfreitas [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.01
Fixed in: (no value)



Subject: not working inside Test::Class
Greetings, I've being trying to use stdout_like function without success while inside a subclass of Test::Class. I'm not sure if this a problem with Test::Class or Test::Output, but the fact is that I can use Test::Output stdout_like if I'm outside of Test::Class. I attached two different tests for you to try to reproduce the following errors: prove -I ~/Projetos/siebel-monitoring-tools/Siebel-Srvrmgr/lib t/ActionDumperFunctionRef.t t/ActionDumperFunctionRef.t .. 1/21 # Failed test 'class_methods died (Undefined subroutine &Test::Action::DumperFunctionRef::stdout_like called at t/Test/Action/DumperFunctionRef.pm line 15.)' # at t/ActionDumperFunctionRef.t line 4. # (in Test::Action::DumperFunctionRef->class_methods) # Looks like you failed 1 test of 21. t/ActionDumperFunctionRef.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/21 subtests Test Summary Report ------------------- t/ActionDumperFunctionRef.t (Wstat: 256 Tests: 21 Failed: 1) Failed test: 11 Non-zero exit status: 1 Files=1, Tests=21, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.50 cusr 0.02 csys = 0.55 CPU) Result: FAIL And also using a anonymous block: prove -I ~/Projetos/siebel-monitoring-tools/Siebel-Srvrmgr/lib t/ActionDumperBlock.t t/ActionDumperBlock.t .. 1/33 # Failed test 'class_methods died (Can't call method "stdout_like" without a package or object reference at t/Test/Action/DumperBlock.pm line 18.)' # at t/ActionDumperBlock.t line 4. # (in Test::Action::DumperBlock->class_methods) # Looks like you failed 1 test of 33. t/ActionDumperBlock.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/33 subtests Test Summary Report ------------------- t/ActionDumperBlock.t (Wstat: 256 Tests: 33 Failed: 1) Failed test: 33 Non-zero exit status: 1 Files=1, Tests=33, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.36 cusr 0.01 csys = 0.39 CPU) Result: FAIL You will need to fetch the most recent code from the SVN repository of Siebel-Srvrmgr for testing those two cases: https://code.google.com/p/siebel-monitoring-tools/source/browse/#svn%2Ftrunk%2FSiebel-Srvrmgr Please copy the *.t and *.pm files in the appropriate directories under the t/ directory of the distribution. I was able to provide a workaround with the ActionDumper.pm class available in the SVN repository. Below follows my test environment information: Summary of my perl5 (revision 5 version 16 subversion 3) configuration: Platform: osname=linux, osvers=3.8.0-23-generic, archname=x86_64-linux uname='linux yggdrasil 3.8.0-23-generic #34-ubuntu smp wed may 29 20:22:58 utc 2013 x86_64 x86_64 x86_64 gnulinux ' config_args='-de -Dprefix=/home/jackal/perl5/perlbrew/perls/perl-5.16.3 -Aeval:scriptdir=/home/jackal/perl5/perlbrew/perls/perl-5.16.3/bin' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.7.3', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib libs=-lnsl -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.17' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF Built under linux Compiled at Jun 3 2013 03:03:17 %ENV: PERL5LIB="/home/jackal/Projetos/siebel-monitoring-tools/lib:/home/jackal/Projetos/siebel-code-analyzer/testing:/usr/lib/cgi-bin" PERLBREW_MANPATH="/home/jackal/perl5/perlbrew/perls/perl-5.16.3/man" PERLBREW_PATH="/home/jackal/perl5/perlbrew/bin:/home/jackal/perl5/perlbrew/perls/perl-5.16.3/bin" PERLBREW_PERL="perl-5.16.3" PERLBREW_ROOT="/home/jackal/perl5/perlbrew" PERLBREW_SKIP_INIT="1" PERLBREW_VERSION="0.63" @INC: /home/jackal/Projetos/siebel-monitoring-tools/lib /home/jackal/Projetos/siebel-code-analyzer/testing /usr/lib/cgi-bin /home/jackal/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/x86_64-linux /home/jackal/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3 /home/jackal/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3/x86_64-linux /home/jackal/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3 . Please let me know if you need additional information or help with the tests. Regards, Alceu
Subject: ActionDumperBlock.t
use lib 't'; use Test::Action::DumperBlock; Test::Class->runtests;
Subject: ActionDumperFunctionRef.t
use lib 't'; use Test::Action::DumperFunctionRef; Test::Class->runtests;
Subject: DumperBlock.pm
package Test::Action::DumperBlock; use Test::Output qw(:stdout); use base 'Test::Action'; use Test::More; sub class { 'Siebel::Srvrmgr::Daemon::Action::Dumper' } sub class_methods : Test(+1) { my $test = shift; $test->SUPER::class_methods(); my @data = <DATA>; close(DATA); stdout_like { $test->{action}->do( \@data ) } qr/^\$VAR1\s\=\s\[\n\s+\'\n\'\,\n\s+\'SV_NAME\s+CC_ALIAS/, 'got correct dumped content'; } 1; __DATA__ SV_NAME CC_ALIAS TK_TASKID TK_PID TK_DISP_RUNSTATE CC_RUNMODE TK_START_TIME TK_END_TIME TK_STATUS CG_ALIAS TK_PARENT_T CC_INCARN_NO TK_LABEL TK_TASKTYPE TK_PING_TIM ------- -------------- --------- ------ ---------------- ----------- ------------------- ------------------- --------------------------------------------------------------------------------------- --------- ----------- ------------ ------------------------ ----------- ----------- SUsrvr ServerMgr 32505858 916 Running Interactive 2012-02-13 08:14:36 2000-00-00 00:00:00 Processing "List Tasks" command System 0 Normal SUsrvr TaskLogCleanup 31457282 3292 Running Background 2012-02-13 08:14:15 2000-00-00 00:00:00 TaskUI 0 SADMIN Normal SUsrvr TxnProc 29360130 3160 Running Background 2012-02-13 08:14:15 2000-00-00 00:00:00 Cleaning routed .dx files... Remote 0 Normal SUsrvr TxnRoute 28311554 3104 Running Background 2012-02-13 08:14:15 2000-00-00 00:00:00 Iteration 1: Sleeping for 60 seconds... Remote 0 Normal SUsrvr TxnMerge 25165826 2980 Running Background 2012-02-13 08:14:14 2000-00-00 00:00:00 Iteration 0: Sleeping for 40 seconds... Remote 0 Normal SUsrvr SBRWorkMon 13631490 2776 Running Background 2012-02-13 08:14:13 2000-00-00 00:00:00 Sleeping for 50 seconds... Workflow 0 Normal SUsrvr SBRWorkActn 9437186 2736 Running Background 2012-02-13 08:14:12 2000-00-00 00:00:00 Sleeping for 50 seconds... Workflow 0 Normal SUsrvr SvrTblCleanup 8388610 2392 Running Background 2012-02-13 08:14:07 2000-00-00 00:00:00 Invoking method DelCompletedDelExpiredReq for service Message Board Maintenance Service SystemAux 0 SADMIN Normal SUsrvr SvrTaskPersist 7340034 2448 Running Background 2012-02-13 08:14:07 2000-00-00 00:00:00 Invoking method InsertUpdateTaskHistory for service Message Board Maintenance Service SystemAux 0 SADMIN Normal SUsrvr SRProc 5242888 2416 Running Interactive 2012-02-13 08:14:10 2000-00-00 00:00:00 SystemAux 0 Normal SUsrvr SRProc 5242885 2416 Running Interactive 2012-02-13 08:14:09 2000-00-00 00:00:00 SystemAux 0 Forwarding Task Worker SUsrvr SRBroker 3145755 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145754 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145753 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145752 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145751 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145750 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145749 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145748 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145747 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145746 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145745 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145744 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145743 2312 Running Interactive 2012-02-13 08:14:13 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145742 2312 Running Interactive 2012-02-13 08:14:13 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145740 2312 Running Interactive 2012-02-13 08:14:09 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145739 2312 Running Interactive 2012-02-13 08:14:08 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145738 2312 Running Interactive 2012-02-13 08:14:08 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145736 2312 Running Interactive 2012-02-13 08:14:02 2000-00-00 00:00:00 System 0 Store task Worker SUsrvr SRBroker 3145735 2312 Running Interactive 2012-02-13 08:14:02 2000-00-00 00:00:00 System 0 Response task Worker SUsrvr SRBroker 3145734 2312 Running Interactive 2012-02-13 08:14:02 2000-00-00 00:00:00 System 0 Task creation task Worker SUsrvr SRBroker 3145733 2312 Running Interactive 2012-02-13 08:14:02 2000-00-00 00:00:00 System 0 Information caching task Worker SUsrvr SCBroker 2097154 2324 Running Background 2012-02-13 08:13:56 2000-00-00 00:00:00 System 0 Normal 33 rows returned.
Subject: DumperFunctionRef.pm
package Test::Action::DumperFunctionRef; #use Test::Output qw(:stdout); use base 'Test::Action'; use Test::More; sub class { 'Siebel::Srvrmgr::Daemon::Action::Dumper' } sub class_methods : Test(+1) { my $test = shift; $test->SUPER::class_methods(); stdout_like( \&foobar($test), qr/^\$VAR1\s\=\s\[\n\s+\'\n\'\,\n\s+\'SV_NAME\s+CC_ALIAS/, 'got correct dumped content' ); } sub foobar { my $test = shift; my @data = <DATA>; close(DATA); $test->{action}->do( \@data ); } 1; __DATA__ SV_NAME CC_ALIAS TK_TASKID TK_PID TK_DISP_RUNSTATE CC_RUNMODE TK_START_TIME TK_END_TIME TK_STATUS CG_ALIAS TK_PARENT_T CC_INCARN_NO TK_LABEL TK_TASKTYPE TK_PING_TIM ------- -------------- --------- ------ ---------------- ----------- ------------------- ------------------- --------------------------------------------------------------------------------------- --------- ----------- ------------ ------------------------ ----------- ----------- SUsrvr ServerMgr 32505858 916 Running Interactive 2012-02-13 08:14:36 2000-00-00 00:00:00 Processing "List Tasks" command System 0 Normal SUsrvr TaskLogCleanup 31457282 3292 Running Background 2012-02-13 08:14:15 2000-00-00 00:00:00 TaskUI 0 SADMIN Normal SUsrvr TxnProc 29360130 3160 Running Background 2012-02-13 08:14:15 2000-00-00 00:00:00 Cleaning routed .dx files... Remote 0 Normal SUsrvr TxnRoute 28311554 3104 Running Background 2012-02-13 08:14:15 2000-00-00 00:00:00 Iteration 1: Sleeping for 60 seconds... Remote 0 Normal SUsrvr TxnMerge 25165826 2980 Running Background 2012-02-13 08:14:14 2000-00-00 00:00:00 Iteration 0: Sleeping for 40 seconds... Remote 0 Normal SUsrvr SBRWorkMon 13631490 2776 Running Background 2012-02-13 08:14:13 2000-00-00 00:00:00 Sleeping for 50 seconds... Workflow 0 Normal SUsrvr SBRWorkActn 9437186 2736 Running Background 2012-02-13 08:14:12 2000-00-00 00:00:00 Sleeping for 50 seconds... Workflow 0 Normal SUsrvr SvrTblCleanup 8388610 2392 Running Background 2012-02-13 08:14:07 2000-00-00 00:00:00 Invoking method DelCompletedDelExpiredReq for service Message Board Maintenance Service SystemAux 0 SADMIN Normal SUsrvr SvrTaskPersist 7340034 2448 Running Background 2012-02-13 08:14:07 2000-00-00 00:00:00 Invoking method InsertUpdateTaskHistory for service Message Board Maintenance Service SystemAux 0 SADMIN Normal SUsrvr SRProc 5242888 2416 Running Interactive 2012-02-13 08:14:10 2000-00-00 00:00:00 SystemAux 0 Normal SUsrvr SRProc 5242885 2416 Running Interactive 2012-02-13 08:14:09 2000-00-00 00:00:00 SystemAux 0 Forwarding Task Worker SUsrvr SRBroker 3145755 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145754 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145753 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145752 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145751 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145750 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145749 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145748 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145747 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145746 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145745 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145744 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145743 2312 Running Interactive 2012-02-13 08:14:13 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145742 2312 Running Interactive 2012-02-13 08:14:13 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145740 2312 Running Interactive 2012-02-13 08:14:09 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145739 2312 Running Interactive 2012-02-13 08:14:08 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145738 2312 Running Interactive 2012-02-13 08:14:08 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145736 2312 Running Interactive 2012-02-13 08:14:02 2000-00-00 00:00:00 System 0 Store task Worker SUsrvr SRBroker 3145735 2312 Running Interactive 2012-02-13 08:14:02 2000-00-00 00:00:00 System 0 Response task Worker SUsrvr SRBroker 3145734 2312 Running Interactive 2012-02-13 08:14:02 2000-00-00 00:00:00 System 0 Task creation task Worker SUsrvr SRBroker 3145733 2312 Running Interactive 2012-02-13 08:14:02 2000-00-00 00:00:00 System 0 Information caching task Worker SUsrvr SCBroker 2097154 2324 Running Background 2012-02-13 08:13:56 2000-00-00 00:00:00 System 0 Normal 33 rows returned.
Subject: Re: [rt.cpan.org #85816] not working inside Test::Class
Date: Mon, 3 Jun 2013 09:30:06 -0500
To: bug-Test-Output [...] rt.cpan.org
From: brian d foy <bdfoy [...] cpan.org>
Noted. I don't have time to look into this, but when someone figures it out and has a patch, I can apply it and upload a new release.
Subject: Re: [rt.cpan.org #85816] not working inside Test::Class
Date: Mon, 3 Jun 2013 09:44:49 -0500
To: bug-Test-Output [...] rt.cpan.org
From: Jeff Holt <jeff.holt [...] method-r.com>
I might be able to look at this today. If I figure it out, I'll send a potential patch to brian. On Mon, Jun 3, 2013 at 9:31 AM, brian d foy via RT < bug-Test-Output@rt.cpan.org> wrote: Show quoted text
> Queue: Test-Output > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=85816 > > > Noted. I don't have time to look into this, but when someone figures > it out and has a patch, I can apply it and upload a new release. > >
Subject: Re: [rt.cpan.org #85816] not working inside Test::Class
Date: Tue, 4 Jun 2013 15:47:10 -0500
To: bug-Test-Output [...] rt.cpan.org
From: Jeff Holt <jeff.holt [...] method-r.com>
There is a relationship between these errors and the existence of t/Test/Output.pm. If you remove this file, then you won't get the errors. So, that leads me to ask for a MUCH simpler test case or a more complete explanation for why Test/Output.pm is present and what purpose it has. On Mon, Jun 3, 2013 at 3:19 AM, Alceu Rodrigues de Freitas Junior via RT < bug-Test-Output@rt.cpan.org> wrote: Show quoted text
> Mon Jun 03 04:19:42 2013: Request 85816 was acted upon. > Transaction: Ticket created by ARFREITAS > Queue: Test-Output > Subject: not working inside Test::Class > Broken in: 1.01 > Severity: (no value) > Owner: Nobody > Requestors: arfreitas@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=85816 > > > > Greetings, > > I've being trying to use stdout_like function without success while inside > a subclass of Test::Class. I'm not sure if this a problem with Test::Class > or Test::Output, but the fact is that I can use Test::Output stdout_like if > I'm outside of Test::Class. > > I attached two different tests for you to try to reproduce the following > errors: > > prove -I ~/Projetos/siebel-monitoring-tools/Siebel-Srvrmgr/lib > t/ActionDumperFunctionRef.t > t/ActionDumperFunctionRef.t .. 1/21 > # Failed test 'class_methods died (Undefined subroutine > &Test::Action::DumperFunctionRef::stdout_like called at > t/Test/Action/DumperFunctionRef.pm line 15.)' > # at t/ActionDumperFunctionRef.t line 4. > # (in Test::Action::DumperFunctionRef->class_methods) > # Looks like you failed 1 test of 21. > t/ActionDumperFunctionRef.t .. Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/21 subtests > > Test Summary Report > ------------------- > t/ActionDumperFunctionRef.t (Wstat: 256 Tests: 21 Failed: 1) > Failed test: 11 > Non-zero exit status: 1 > Files=1, Tests=21, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.50 cusr > 0.02 csys = 0.55 CPU) > Result: FAIL > > And also using a anonymous block: > > prove -I ~/Projetos/siebel-monitoring-tools/Siebel-Srvrmgr/lib > t/ActionDumperBlock.t > t/ActionDumperBlock.t .. 1/33 > # Failed test 'class_methods died (Can't call method "stdout_like" > without a package or object reference at t/Test/Action/DumperBlock.pm line > 18.)' > # at t/ActionDumperBlock.t line 4. > # (in Test::Action::DumperBlock->class_methods) > # Looks like you failed 1 test of 33. > t/ActionDumperBlock.t .. Dubious, test returned 1 (wstat 256, 0x100) > Failed 1/33 subtests > > Test Summary Report > ------------------- > t/ActionDumperBlock.t (Wstat: 256 Tests: 33 Failed: 1) > Failed test: 33 > Non-zero exit status: 1 > Files=1, Tests=33, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.36 cusr > 0.01 csys = 0.39 CPU) > Result: FAIL > > You will need to fetch the most recent code from the SVN repository of > Siebel-Srvrmgr for testing those two cases: > > > https://code.google.com/p/siebel-monitoring-tools/source/browse/#svn%2Ftrunk%2FSiebel-Srvrmgr > > Please copy the *.t and *.pm files in the appropriate directories under > the t/ directory of the distribution. > > I was able to provide a workaround with the ActionDumper.pm class > available in the SVN repository. > > Below follows my test environment information: > > Summary of my perl5 (revision 5 version 16 subversion 3) configuration: > > Platform: > osname=linux, osvers=3.8.0-23-generic, archname=x86_64-linux > uname='linux yggdrasil 3.8.0-23-generic #34-ubuntu smp wed may 29 > 20:22:58 utc 2013 x86_64 x86_64 x86_64 gnulinux ' > config_args='-de > -Dprefix=/home/jackal/perl5/perlbrew/perls/perl-5.16.3 > -Aeval:scriptdir=/home/jackal/perl5/perlbrew/perls/perl-5.16.3/bin' > hint=recommended, useposix=true, d_sigaction=define > useithreads=undef, usemultiplicity=undef > useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef > use64bitint=define, use64bitall=define, uselongdouble=undef > usemymalloc=n, bincompat5005=undef > Compiler: > cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector > -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', > optimize='-O2', > cppflags='-fno-strict-aliasing -pipe -fstack-protector > -I/usr/local/include' > ccversion='', gccversion='4.7.3', gccosandvers='' > intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 > d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 > ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', > lseeksize=8 > alignbytes=8, prototype=define > Linker and Libraries: > ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' > libpth=/usr/local/lib /lib/x86_64-linux-gnu /lib/../lib > /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/lib > libs=-lnsl -ldl -lm -lcrypt -lutil -lc > perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc > libc=, so=so, useshrplib=false, libperl=libperl.a > gnulibc_version='2.17' > Dynamic Linking: > dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' > cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib > -fstack-protector' > > > Characteristics of this binary (from libperl): > Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV > PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL > USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE > USE_LOCALE_COLLATE USE_LOCALE_CTYPE > USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF > Built under linux > Compiled at Jun 3 2013 03:03:17 > %ENV: > > PERL5LIB="/home/jackal/Projetos/siebel-monitoring-tools/lib:/home/jackal/Projetos/siebel-code-analyzer/testing:/usr/lib/cgi-bin" > PERLBREW_MANPATH="/home/jackal/perl5/perlbrew/perls/perl-5.16.3/man" > > PERLBREW_PATH="/home/jackal/perl5/perlbrew/bin:/home/jackal/perl5/perlbrew/perls/perl-5.16.3/bin" > PERLBREW_PERL="perl-5.16.3" > PERLBREW_ROOT="/home/jackal/perl5/perlbrew" > PERLBREW_SKIP_INIT="1" > PERLBREW_VERSION="0.63" > @INC: > /home/jackal/Projetos/siebel-monitoring-tools/lib > /home/jackal/Projetos/siebel-code-analyzer/testing > /usr/lib/cgi-bin > > /home/jackal/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3/x86_64-linux > /home/jackal/perl5/perlbrew/perls/perl-5.16.3/lib/site_perl/5.16.3 > /home/jackal/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3/x86_64-linux > /home/jackal/perl5/perlbrew/perls/perl-5.16.3/lib/5.16.3 > . > > Please let me know if you need additional information or help with the > tests. > > Regards, > Alceu >
Em Ter Jun 04 16:47:29 2013, jeff.holt@method-r.com escreveu: Show quoted text
> There is a relationship between these errors and the existence of > t/Test/Output.pm. If you remove this file, then you won't get the > errors. > So, that leads me to ask for a MUCH simpler test case or a more > complete > explanation for why Test/Output.pm is present and what purpose it has.
Greetings, Test/Output.pm is a test that I added for (obviously) testing output but was not ever really used: I removed it from the repository, including the related Output.t file. I understand now that the package name was probably clashing with Test::Output, just don't understand why I didn't get any message related to redefining the subs. Anyway, I'm sorry about opening a ticket for a non-related issue. If it servers for anything, I may have caught at least another error: after removing the ofending package, I got ActionDumperBlock.t working correctly, but not ActionDumperFunctionRef.t. The Test::Output Pod says it is possible to use a coderef as parameter instead of a block, but the Test::Action::DumperFunctionRef keeps not working. I modied the package again to test more options and attached again for testing: the commented test raises an exception when compiling the code, with this message: DumperFunctionRef.pm|32| Type of arg 1 to Test::Output::stdout_like must be block or sub {} (not subroutine entry) at ~/Projetos/siebel-monitoring-tools/Siebel-Srvrmgr/t/Test/Action/DumperFunctionRef.pm line 32, near "'got correct dumped content')" DumperFunctionRef.pm|37| BEGIN not safe after errors--compilation aborted Even though $y is a coderef (as the previous test confirms). The dies_ok tests get another exception when trying to use a different form of coderef. Please let me know if you need more help. Regards, Alceu
Subject: DumperFunctionRef.pm
package Test::Action::DumperFunctionRef; use Test::Output qw(:stdout); use base 'Test::Action'; use Test::Most; sub class { 'Siebel::Srvrmgr::Daemon::Action::Dumper' } sub class_methods : Test(+3) { my $test = shift; $test->SUPER::class_methods(); my @data = <DATA>; close(DATA); my $y = sub { my $self = shift; $self->{action}->do( \@data ); }; my $regex = qr/^\$VAR1\s\=\s\[\n\s+\'\n\'\,\n\s+\'SV_NAME\s+CC_ALIAS/; dies_ok { stdout_like( \&foobar($test), $regex, 'got correct dumped content' ); } 'expected to die'; is( ref($y), 'CODE', '$y is a code reference' ); # stdout_like( $y->($test), $regex, 'got correct dumped content'); stdout_like( sub { $test->{action}->do( \@data ); }, $regex, 'got correct dumped content' ); } sub foobar { my $test = shift; my $data_ref = shift; $test->{action}->do($data_ref); } 1; __DATA__ SV_NAME CC_ALIAS TK_TASKID TK_PID TK_DISP_RUNSTATE CC_RUNMODE TK_START_TIME TK_END_TIME TK_STATUS CG_ALIAS TK_PARENT_T CC_INCARN_NO TK_LABEL TK_TASKTYPE TK_PING_TIM ------- -------------- --------- ------ ---------------- ----------- ------------------- ------------------- --------------------------------------------------------------------------------------- --------- ----------- ------------ ------------------------ ----------- ----------- SUsrvr ServerMgr 32505858 916 Running Interactive 2012-02-13 08:14:36 2000-00-00 00:00:00 Processing "List Tasks" command System 0 Normal SUsrvr TaskLogCleanup 31457282 3292 Running Background 2012-02-13 08:14:15 2000-00-00 00:00:00 TaskUI 0 SADMIN Normal SUsrvr TxnProc 29360130 3160 Running Background 2012-02-13 08:14:15 2000-00-00 00:00:00 Cleaning routed .dx files... Remote 0 Normal SUsrvr TxnRoute 28311554 3104 Running Background 2012-02-13 08:14:15 2000-00-00 00:00:00 Iteration 1: Sleeping for 60 seconds... Remote 0 Normal SUsrvr TxnMerge 25165826 2980 Running Background 2012-02-13 08:14:14 2000-00-00 00:00:00 Iteration 0: Sleeping for 40 seconds... Remote 0 Normal SUsrvr SBRWorkMon 13631490 2776 Running Background 2012-02-13 08:14:13 2000-00-00 00:00:00 Sleeping for 50 seconds... Workflow 0 Normal SUsrvr SBRWorkActn 9437186 2736 Running Background 2012-02-13 08:14:12 2000-00-00 00:00:00 Sleeping for 50 seconds... Workflow 0 Normal SUsrvr SvrTblCleanup 8388610 2392 Running Background 2012-02-13 08:14:07 2000-00-00 00:00:00 Invoking method DelCompletedDelExpiredReq for service Message Board Maintenance Service SystemAux 0 SADMIN Normal SUsrvr SvrTaskPersist 7340034 2448 Running Background 2012-02-13 08:14:07 2000-00-00 00:00:00 Invoking method InsertUpdateTaskHistory for service Message Board Maintenance Service SystemAux 0 SADMIN Normal SUsrvr SRProc 5242888 2416 Running Interactive 2012-02-13 08:14:10 2000-00-00 00:00:00 SystemAux 0 Normal SUsrvr SRProc 5242885 2416 Running Interactive 2012-02-13 08:14:09 2000-00-00 00:00:00 SystemAux 0 Forwarding Task Worker SUsrvr SRBroker 3145755 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145754 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145753 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145752 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145751 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145750 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145749 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145748 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145747 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145746 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145745 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145744 2312 Running Interactive 2012-02-13 08:14:15 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145743 2312 Running Interactive 2012-02-13 08:14:13 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145742 2312 Running Interactive 2012-02-13 08:14:13 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145740 2312 Running Interactive 2012-02-13 08:14:09 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145739 2312 Running Interactive 2012-02-13 08:14:08 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145738 2312 Running Interactive 2012-02-13 08:14:08 2000-00-00 00:00:00 System 0 Normal SUsrvr SRBroker 3145736 2312 Running Interactive 2012-02-13 08:14:02 2000-00-00 00:00:00 System 0 Store task Worker SUsrvr SRBroker 3145735 2312 Running Interactive 2012-02-13 08:14:02 2000-00-00 00:00:00 System 0 Response task Worker SUsrvr SRBroker 3145734 2312 Running Interactive 2012-02-13 08:14:02 2000-00-00 00:00:00 System 0 Task creation task Worker SUsrvr SRBroker 3145733 2312 Running Interactive 2012-02-13 08:14:02 2000-00-00 00:00:00 System 0 Information caching task Worker SUsrvr SCBroker 2097154 2324 Running Background 2012-02-13 08:13:56 2000-00-00 00:00:00 System 0 Normal 33 rows returned.
Subject: Re: [rt.cpan.org #85816] not working inside Test::Class
Date: Wed, 5 Jun 2013 08:09:27 -0500
To: bug-Test-Output [...] rt.cpan.org
From: Jeff Holt <jeff.holt [...] method-r.com>
Here are the reasons for the trouble with line 34 of the attached test: (a) it is an anonymous subroutine, not a block, (b) it included the enclosing '(' and the ')' and (c) there is a ',' between the first and second arguments. In other words, if the code had looked like this stdout_like { $test->{action}->do( \@data ); } $regex, 'got correct dumped content' ; then it would parse and probably accomplish what you intend. <opinion>It is unwise to publish the fact that a code block is permissible because it leads to confusion. The confusion probably does cause much wasted time until the maintainer comes along. That's when the real damage is done.</opinion> On Wed, Jun 5, 2013 at 5:55 AM, Alceu Rodrigues de Freitas Junior via RT < bug-Test-Output@rt.cpan.org> wrote: Show quoted text
> Queue: Test-Output > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=85816 > > > Em Ter Jun 04 16:47:29 2013, jeff.holt@method-r.com escreveu:
> > There is a relationship between these errors and the existence of > > t/Test/Output.pm. If you remove this file, then you won't get the > > errors. > > So, that leads me to ask for a MUCH simpler test case or a more > > complete > > explanation for why Test/Output.pm is present and what purpose it has.
> > Greetings, > > Test/Output.pm is a test that I added for (obviously) testing output but > was not ever really used: I removed it from the repository, including the > related Output.t file. I understand now that the package name was probably > clashing with Test::Output, just don't understand why I didn't get any > message related to redefining the subs. > > Anyway, I'm sorry about opening a ticket for a non-related issue. > > If it servers for anything, I may have caught at least another error: > after removing the ofending package, I got ActionDumperBlock.t working > correctly, but not ActionDumperFunctionRef.t. > > The Test::Output Pod says it is possible to use a coderef as parameter > instead of a block, but the Test::Action::DumperFunctionRef keeps not > working. > > I modied the package again to test more options and attached again for > testing: the commented test raises an exception when compiling the code, > with this message: > > DumperFunctionRef.pm|32| Type of arg 1 to Test::Output::stdout_like must > be block or sub {} (not subroutine entry) at > ~/Projetos/siebel-monitoring-tools/Siebel-Srvrmgr/t/Test/Action/DumperFunctionRef.pm > line 32, near "'got correct dumped content')" > DumperFunctionRef.pm|37| BEGIN not safe after errors--compilation aborted > > Even though $y is a coderef (as the previous test confirms). > > The dies_ok tests get another exception when trying to use a different > form of coderef. > > Please let me know if you need more help. > > Regards, > Alceu >
Subject: Re: [rt.cpan.org #85816] not working inside Test::Class
Date: Wed, 5 Jun 2013 08:13:34 -0500
To: bug-Test-Output [...] rt.cpan.org
From: Jeff Holt <jeff.holt [...] method-r.com>
that's "does not cause" rather than "does cause" On Wed, Jun 5, 2013 at 8:09 AM, Jeff Holt via RT < bug-Test-Output@rt.cpan.org> wrote: Show quoted text
> Queue: Test-Output > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=85816 > > > Here are the reasons for the trouble with line 34 of the attached test: (a) > it is an anonymous subroutine, not a block, (b) it included the enclosing > '(' and the ')' and (c) there is a ',' between the first and second > arguments. > > In other words, if the code had looked like this > > stdout_like { $test->{action}->do( \@data ); } > $regex, 'got correct dumped content' ; > > > then it would parse and probably accomplish what you intend. > > <opinion>It is unwise to publish the fact that a code block is permissible > because it leads to confusion. The confusion probably does cause much > wasted time until the maintainer comes along. That's when the real damage > is done.</opinion> > > > On Wed, Jun 5, 2013 at 5:55 AM, Alceu Rodrigues de Freitas Junior via RT < > bug-Test-Output@rt.cpan.org> wrote: >
> > Queue: Test-Output > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=85816 > > > > > Em Ter Jun 04 16:47:29 2013, jeff.holt@method-r.com escreveu:
> > > There is a relationship between these errors and the existence of > > > t/Test/Output.pm. If you remove this file, then you won't get the > > > errors. > > > So, that leads me to ask for a MUCH simpler test case or a more > > > complete > > > explanation for why Test/Output.pm is present and what purpose it has.
> > > > Greetings, > > > > Test/Output.pm is a test that I added for (obviously) testing output but > > was not ever really used: I removed it from the repository, including the > > related Output.t file. I understand now that the package name was
> probably
> > clashing with Test::Output, just don't understand why I didn't get any > > message related to redefining the subs. > > > > Anyway, I'm sorry about opening a ticket for a non-related issue. > > > > If it servers for anything, I may have caught at least another error: > > after removing the ofending package, I got ActionDumperBlock.t working > > correctly, but not ActionDumperFunctionRef.t. > > > > The Test::Output Pod says it is possible to use a coderef as parameter > > instead of a block, but the Test::Action::DumperFunctionRef keeps not > > working. > > > > I modied the package again to test more options and attached again for > > testing: the commented test raises an exception when compiling the code, > > with this message: > > > > DumperFunctionRef.pm|32| Type of arg 1 to Test::Output::stdout_like must > > be block or sub {} (not subroutine entry) at > >
> ~/Projetos/siebel-monitoring-tools/Siebel-Srvrmgr/t/Test/Action/DumperFunctionRef.pm
> > line 32, near "'got correct dumped content')" > > DumperFunctionRef.pm|37| BEGIN not safe after errors--compilation aborted > > > > Even though $y is a coderef (as the previous test confirms). > > > > The dies_ok tests get another exception when trying to use a different > > form of coderef. > > > > Please let me know if you need more help. > > > > Regards, > > Alceu > >
> >