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

Add test case stats functionality and test case name priority output #2946

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

Conversation

ligazetom
Copy link

@ligazetom ligazetom commented Jan 12, 2025

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 #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

#1579

StreamingReporterBase::testCaseStarting( testInfo );

if ( m_config->outputTestCaseNameFirst() ) {
m_stream << testInfo.name << ":\n";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the point of this is to print the test case name before we segfault I guess flush would be nice.

Copy link

codecov bot commented Jan 12, 2025

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     

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.

1 participant