test-class
test-class copied to clipboard
Summarise all the classes, and methods, that failed in verbose mode.
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.
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
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 :-) .