Catch2 icon indicating copy to clipboard operation
Catch2 copied to clipboard

Add test case stats functionality and test case name priority output

Open ligazetom opened this issue 1 year ago • 1 comments

Description

Add 2 new flags --output-test-case-name-first and --output-test-case-stats. Former will print name of the test case before it is run (as was requested here) and the latter will print regular TestCaseName: **stats**. I've seen https://github.com/catchorg/Catch2/pull/2343 so this is a bit more lightweight and hopefully not too much against the grain with the argument namespace polution. idklmk

As is mentioned in refed issue, I was missing this feature as well and as much as I want to understand why it's not yet implemented I don't, but I understand why it's not the default.

This is more of a proposal as I'm not really confident with the naming and even worse, I'm using catch for like 3 days now, so I know very little about its internals and overall design.

With that said, I'd be glad to get some feedback. If this feature will be considered, I'll try to polish this PR more with tests and everything, but for that I'll need to look a bit deeper into docs.

I would split these "features" into two, but because of non-buffered output, there are some interdependencies because of newlines already (as with -s and -d yes would be and idk how many more flags that configure output) between these two, so I wanted to keep them together.

Also atm. I have no idea what table printer does so all I've really done is just ran it, saw it working and here we are.

Also, since everything was so easily accessible, this was pretty much low hanging fruit, I'm even a bit concerned if there isn't such functionality already, but I haven't found it. Would be pretty bad if I've implemented something that's already there. 🤞

GitHub Issues

https://github.com/catchorg/Catch2/issues/1579

ligazetom avatar Jan 12 '25 23:01 ligazetom

Codecov Report

Attention: Patch coverage is 69.23077% with 4 lines in your changes missing coverage. Please review.

Project coverage is 90.94%. Comparing base (914aeec) to head (12195c8).

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #2946      +/-   ##
==========================================
- Coverage   91.01%   90.94%   -0.07%     
==========================================
  Files         198      198              
  Lines        8599     8612      +13     
==========================================
+ Hits         7826     7832       +6     
- Misses        773      780       +7     

codecov[bot] avatar Jan 12 '25 23:01 codecov[bot]