Wrap macro test driver code inside ptf::TestRunner#2088
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #2088 +/- ##
==========================================
- Coverage 82.66% 82.62% -0.04%
==========================================
Files 332 332
Lines 60155 60208 +53
Branches 12768 12778 +10
==========================================
+ Hits 49727 49749 +22
- Misses 9019 9042 +23
- Partials 1409 1417 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 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. :) |
# Conflicts: # Tests/PcppTestFramework/PcppTestFrameworkRun.h
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.