Wrap macro test driver code inside ptf::TestRunner#2088
Wrap macro test driver code inside ptf::TestRunner#2088Dimi1010 wants to merge 3 commits intoseladb:devfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #2088 +/- ##
==========================================
- Coverage 84.42% 83.97% -0.45%
==========================================
Files 312 316 +4
Lines 56369 57031 +662
Branches 11603 11799 +196
==========================================
+ Hits 47587 47893 +306
- Misses 7637 7975 +338
- Partials 1145 1163 +18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@Dimi1010 this is (yet another) PR with many changes that is hard to review... TBH I'm not sure what's the benefit of it... |
The main benefit is improved IDE step through debugging support. When the code is directly embedded into the macro, it can't be stepped through via debugger (which I needed at the time I made this) since the IDE doesn't "see" the source code in the files. You also can't place breakpoints on it. For example The changes are mainly just moving the code without functional changes. I can separate the rename of The reason behind the rename of
Edit: The link is to the C reference, but it also applies to the C++ language spec here.
PS: I suppose I should have elaborated more in the PR description in the first place. Sorry. |
|
@seladb Reverted the changes that aren't critical to the PR and improved the PR description. Hope it helps. :) |
The PR wraps the test driver code that was previously embedded in the macros
PTF_START_RUNNING_TESTS,PTF_RUN_TESTandPTF_END_RUNNING_TESTSinside theptf::TestRunnerclass.Rationale
The change improves debugging UX by allowing step through debugging inside the test driver code.
Previously the embedded macro code was not "seen" by the IDE environment as actual code. This meant that debugging functionality like breakpoints and step through debuggers were unavailable inside those fragments. The entire macro code was treated as one line, instead of a code block.
Changes
The PR moves the code from the embedded macros into a wrapper class
TestRunner. This allows the IDE to treat the code as regular code instead of macro text, thus allowing improved debugger support.The functionality has been moved according to the following table:
TestRunnerconstructorTestRunner::runTestTestRunner::finalizeResultsCompatibility
The old macros are kept as thin wrappers over the
TestRunnerinstance to preserve compatibility with existing code.