Skip Menu |
 

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

Report information
The Basics
Id: 8596
Status: resolved
Priority: 0/
Queue: Test-Harness

People
Owner: andy [...] hexten.net
Requestors: acs1.acp7 [...] ubitmail.buffalo.edu
Cc:
AdminCc:

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



Subject: Feature Request (Obtaining failed test information when runtests is done)
Date: Wed, 24 Nov 2004 13:16:47 -0500
From: "Potozniak, Andrew" <acs1.acp7 [...] ubitmail.buffalo.edu>
To: <bug-test-harness [...] rt.cpan.org>
Download (untitled) / with headers
text/plain 1.1k
It would be nice to obtain a list of tests that failed including: the number of the test, the text of the test, the expected value, actual value, and the file the test was from after the Test::Harness is done running the tests you had it run. For example: use Test::Harness; my @tests = ('test1.t', 'test2.t', 'test3.t', 'test4.t', 'test5.t', 'test6.t', 'test7.t'); &Test::Harness::runtests(@tests); #Where results is a hash of the tests that were run if they passed, expected value, actual value, file the test was in, the number of the test, etc my %results = %{Test::Harness::getResults()}; #Then one can go through the hash and get the information they want and report it to the screen. #Or you could even write something along the lines of: my %failed_tests = %{Test::Harness::getFailedTests()}; #Which would do the same as getReuslts but only return the tests that failed. #The hash structure could be like the following: #%results = ( <filename.t> => { passed => true|false, # test_text => string, # etc.} # );
Date: Wed, 24 Nov 2004 17:15:00 -0500
From: Michael G Schwern <schwern [...] pobox.com>
To: "Potozniak, Andrew via RT" <bug-Test-Harness [...] rt.cpan.org>
CC: undisclosed-recipients: ;
Subject: Re: [cpan #8596] Feature Request (Obtaining failed test information when runtests is done)
RT-Send-Cc:
Download (untitled) / with headers
text/plain 789b
On Wed, Nov 24, 2004 at 01:27:21PM -0500, Potozniak, Andrew via RT wrote: Show quoted text
> It would be nice to obtain a list of tests that failed including: the > number of the test, the text of the test, the expected value, actual > value, and the file the test was from after the Test::Harness is done > running the tests you had it run.
I assume you mean programatically as opposed to the printout at the end which T::H alread provides. Test::Harness::Straps exists for this purpose, though its not as easy as it should be to do what you want. You can, unofficially, get at the internal strap using $Test::Harness::Strap but there is currently no way to get the results from just the strap. -- Michael G Schwern schwern@pobox.com http://www.pobox.com/~schwern/ I'm exploring my nipples.
Date: Wed, 24 Nov 2004 17:15:00 -0500
From: Michael G Schwern <schwern [...] pobox.com>
To: "Potozniak, Andrew via RT" <bug-Test-Harness [...] rt.cpan.org>
CC: undisclosed-recipients: ;
Subject: Re: [cpan #8596] Feature Request (Obtaining failed test information when runtests is done)
RT-Send-Cc:
Download (untitled) / with headers
text/plain 789b
On Wed, Nov 24, 2004 at 01:27:21PM -0500, Potozniak, Andrew via RT wrote: Show quoted text
> It would be nice to obtain a list of tests that failed including: the > number of the test, the text of the test, the expected value, actual > value, and the file the test was from after the Test::Harness is done > running the tests you had it run.
I assume you mean programatically as opposed to the printout at the end which T::H alread provides. Test::Harness::Straps exists for this purpose, though its not as easy as it should be to do what you want. You can, unofficially, get at the internal strap using $Test::Harness::Strap but there is currently no way to get the results from just the strap. -- Michael G Schwern schwern@pobox.com http://www.pobox.com/~schwern/ I'm exploring my nipples.
Obsoleted by 2.99


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.