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

Location #241

Closed
wants to merge 9 commits into from
Closed

Location #241

wants to merge 9 commits into from

Conversation

lp55
Copy link

@lp55 lp55 commented Dec 17, 2019

This is a first try at at adding the location information of the caller to the test constructor to be able to have the filename available to the test_begin data structure. Ignore the exception stuff (as it belongs to another PR) and see what you think. Maybe the initializer list can became a variadic template. But before I improve this, I wanna to see if this is an agreeable path forward.

@@ -1466,10 +1477,23 @@ template <class... Ts, class TEvent>
struct test {
utility::string_view type{};
utility::string_view name{};
reflection::source_location location;

constexpr test(std::initializer_list<utility::string_view> l, const reflection::source_location& currentLocation =
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm afraid that this solution will always produce ut.hpp as the file_name 🤔 I believe to get it working we have to do it in the callee side, in ""_test in this case.

Copy link
Author

@lp55 lp55 Dec 17, 2019

Choose a reason for hiding this comment

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

Arg, I thought it work due to a cache of another include that filled the filename (it was for another test). I though I removed, but it's seems I didn't. When it worked I just pressumed UDL was simply syntax sugar and that the compiler was really calling the contructor directily (thus with the default value location parameter). Not the case then. Forget about this attempt then :(

@lp55 lp55 closed this Dec 17, 2019
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.

None yet

2 participants