You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is if any of these checks fail, the output always shows the location of the BOOST_TEST_EQ line, not the location of the particular use of checker.
Proposed solution 1:
Make test_with_impl API public, so that the user is able to define his own BOOST_TEST_EQ-like macro that will pass a custom source location. This leaves the implementation of such source location tracking mechanism to the user.
Proposed solution 2:
Add a new set of macros that will use a custom source location that was saved previously by a new macro (let's call it BOOST_TEST_CHECKPOINT). The user will use BOOST_TEST_CHECKPOINT to save the location of the original use of the checker. Alternatively (or additionally) we could provide a non-macro API to the same effect. Usage example:
In my case, I will need a checkpoint-like approach anyway since the checker is not called directly by the test code. But a set of macros that accept a custom location will work. I don't think we need to raise the minimum C++ version for that.
Suppose we have a common utility class that performs a check on the passed value:
and then we use this class in multiple tests with different types and expected values.
The problem is if any of these checks fail, the output always shows the location of the
BOOST_TEST_EQ
line, not the location of the particular use ofchecker
.Proposed solution 1:
Make
test_with_impl
API public, so that the user is able to define his ownBOOST_TEST_EQ
-like macro that will pass a custom source location. This leaves the implementation of such source location tracking mechanism to the user.Proposed solution 2:
Add a new set of macros that will use a custom source location that was saved previously by a new macro (let's call it
BOOST_TEST_CHECKPOINT
). The user will useBOOST_TEST_CHECKPOINT
to save the location of the original use of thechecker
. Alternatively (or additionally) we could provide a non-macro API to the same effect. Usage example:The text was updated successfully, but these errors were encountered: