houseabsolute / test-class-moose

Serious testing for serious Perl
http://metacpan.org/release/Test-Class-Moose/
Other
18 stars 32 forks source link

Show class/method names in non-verbose mode. #76

Open Ovid opened 7 years ago

Ovid commented 7 years ago

This is not a pull request because it's a proof of concept. This branch allows you to pass a verbose switch to the constructor to make it easier to see class and method names while running in non-verbose mode. I've often wanted that and in this case, it's because of this:

$ prove t/tcm.t
t/tcm.t .. 283/303

That was my tests hanging on test 283, but having no real way of knowing which test it was. Running the full test suite in verbose mode solved that, but it would be nice to see test progress without full verbose mode.

Thus, the branch I pushed allows that, but the output is very ugly. Further, I'm not familiar with the new Test::Builder, so the tests were mystifying to me. Thus, there's code and docs, but no tests. However, it runs just fine on my test suite.

This ticket is more for discussion than for merging the code (unless you think it's useful enough for that).

autarch commented 7 years ago

This looks mostly fine as is except it needs support in Role::CLI and it needs tests. That CLI should allow -v -v or -vv instead requiring -v 2. I think the former is more idiomatic.

autarch commented 7 years ago

Also note that Travis failed the branch because you misspelled "running" in the docs you added.

autarch commented 7 years ago

I just looked at this again and realized there's another issue. You're really not supposed to pass around Test2 context objects like that. You have to create a new one in each spot where you want to use it.

Ovid commented 7 years ago

Sadly, I have absolutely zero time to work on this right now. I don't know Test2 well and I've not the foggiest idea of how to write tests for it. Sorry :(

autarch commented 7 years ago

When I have some round tuits I can work on this. Doing it right with the context isn't that hard.

autarch commented 6 years ago

Do you want to do this as an extension now that the API is amenable to it or do you still want this in the core? I'm certainly open to coring it since it does seem generally useful. But OTOH it'd be nice to actually test the extension mechanism now that it exists.