-
Notifications
You must be signed in to change notification settings - Fork 36
Fix missing C stderr output (fprintf(stderr, ...) not shown) #402
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #402 +/- ##
==========================================
+ Coverage 81.77% 81.81% +0.04%
==========================================
Files 20 20
Lines 845 847 +2
Branches 87 89 +2
==========================================
+ Hits 691 693 +2
Misses 154 154
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
| namespace xcpp | ||
| { | ||
| struct StreamRedirectRAII { | ||
| std::string &out; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: member 'out' of type 'std::string &' (aka 'basic_string &') is a reference [cppcoreguidelines-avoid-const-or-ref-data-members]
std::string &out;
^| : out(o), err(e) | ||
| { | ||
| Cpp::BeginStdStreamCapture(Cpp::kStdOut); | ||
| Cpp::BeginStdStreamCapture(Cpp::kStdErr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "Cpp::kStdErr" is directly included [misc-include-cleaner]
Cpp::BeginStdStreamCapture(Cpp::kStdErr);
^|
I have checked this PR, and it does solve the problem. @anutosh491 make the clang tidy and clang format workflows happy, and I will approve and take in. |
Thank you, I shall do that soon (afk for sometime) We technically need to track that we should test such fixes in favour of the C Kernel whenever we end up with a framework for that. I haven't gone through all the discussion but as far as I remember, cppinterop needs to provide us with a utility to differentiate between C++ and C snippets isn't it ? |
Yes, that is exactly what needs to be done to enable c kernel tests. I have already tested the other small change which would be needed in test_xcpp_kernel.py to run the c kernel tests. If you mention all the things you think the c kernel tests should be testing in the issue already open about adding c tests #394 then I can add them once the cppinterop utility is available. |



Description
Fixes #381
Type of change
Please tick all options which are relevant.