Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Summarise all the classes, and methods, that failed in verbose mode. #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

skington
Copy link
Contributor

Another thing that we've monkey-patched at $WORK: if you have a very large test class hierarchy, the standard "You had test failures at test 42, 365, 370..395, 1025, 1213, 1215" message is effectively useless. What we really want to know is, in this huge list of classes, which of them failed.

Hence this patch, to remember where any failures happened, and summarise them at the end.

@karenetheridge
Copy link
Contributor

This doesn't pass its tests (even before rebasing to the latest trunk):

t/fail2.t ...................... 1/2
#   Failed test 'fail2'
#   at t/fail2.t line 38.
# STDOUT is:
# not ok 1 - undef isa 'Object'
# not ok 2 - cannot create Objects
#
# not:
# not ok 1 - The thing isa Object
# not ok 2 - cannot create Objects
#
# as expected
# STDERR is:
# #   Failed test 'undef isa 'Object''
# #   at t/fail2.t line 18.
# #   (in Object::Test->_test_new)
# #     undef isn't defined
# #   Failed test 'cannot create Objects'
# #   at t/fail2.t line 18.
# #   (in Object::Test->_test_new)
#
# not:
# /#\s+Failed\ test.*?\n?.*?at\ t\/fail2\.t line 18.*\n?/
# #   (in Object::Test->_test_new)
# (?^:#\s+The thing isn't defined\n)/#\s+Failed\ test.*?\n?.*?at\ t\/fail2\.t line 18.*\n?/
# #   (in Object::Test->_test_new)
#
# as expected
t/fail2.t ...................... Failed 1/2 subtests

t/runtests_die.t ............... 1/1
#   Failed test 'early die handled'
#   at t/runtests_die.t line 34.
# STDOUT is:
# not ok 1 - undef isa 'Object'
# not ok 2 - test_object died (could not create object)
#
# not:
# not ok 1 - The thing isa Object
# not ok 2 - test_object died (could not create object)
#
# as expected
# STDERR is:
# #   Failed test 'undef isa 'Object''
# #   at t/runtests_die.t line 15.   
# #   (in Foo->test_object)
# #     undef isn't defined
# #   Failed test 'test_object died (could not create object)'
# #   at t/runtests_die.t line 33.   
# #   (in Foo->test_object)
#
# not:
# /#\s+Failed\ test.*?\n?.*?at\ t\/runtests_die\.t line 15.*\n?/
# #   (in Foo->test_object)
# #     The thing isn't defined
# /#\s+Failed\ test.*?\n?.*?at\ t\/runtests_die\.t line 33.*\n?/
# #   (in Foo->test_object)
#
# as expected
t/runtests_die.t ............... Failed 1/1 subtests

t/skip_empty_classes.t ......... 1/5 #
# Bar::Test->the_test

@skington
Copy link
Contributor Author

skington commented May 7, 2014

OK, I'll merge from master and run tests and have a look to see what's changed in the year and a bit since I suggested this - thanks for paying attention, though :-) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants