-
Notifications
You must be signed in to change notification settings - Fork 118
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
Approval Test Integration Bug #234
Comments
Hi, I happen to be one of the maintainers of ApprovalTests.cpp... Am happy to try and help with this, or answer questions, if I can... |
Oh, and thank you for trying to make this integration! |
Hi @claremacrae, It would be great if you could check things on the ApprovalTests.cpp side. As I said I don't think it's an issue there, but I haven't had time to do a in depth debug. |
Hi @lp55 You're welcome... I can reproduce the behaviour you describe, but I can't get a debugger to break in the ApprovalTests code to work out what's going on. It's almost as though it's all being executed at compile time??? |
Are you available to screens-share and pair on this? |
Hi @claremacrae I'm available for screen-share depending on the tool. What do you use? |
Great - How about you email me to github@cfmacrae.fastmail.co.uk and we take it from there? |
We were able to get this working - the key turned out to be that we needed the code that handled auto on(ut::events::test_begin test_begin) -> void {
const std::string fileName =
ut::reflection::source_location::current().file_name();
currentTest.setFileName(fileName);
std::string name = test_begin.name;
currentTest.sections.emplace_back(name);
ApprovalTestNamer::currentTest(¤tTest);
ut::reporter<ut::printer>::on(test_begin);
} |
In case anyone else wants to look at this in the short term, I've attached a slightly-modified version of what we ended up with - renamed to .txt so I could upload it here. @lp55 had kindly offered to work it up to something to add to ApprovalTests.cpp, so that it supports ut directly - thank you! |
Thank you, @lp55 and @claremacrae for your work, very exciting stuff 👍 ApprovalTests looks very interesting and I would love to put a link to the integration between it and it on the website, please keep me in the know when you have something ready so that I can update the website, thanks again 🙏 nice one 👍 |
Closing it for now as there is nothing to do from ut perspective ATM, feel free to reopen the issue and/or ping me with any updates/problems, thanks. |
Hi,
I really like the [Boost].UT framework. It's clean and easy to use and does away with macros. Thanks for developing it!
Anyways, I want to use approval tests (https://github.com/approvals/ApprovalTests.cpp) in a project I'm working on, and I'm implementing the integration between UT <> ApprovalTests.cpp. I followed the guidelines (https://github.com/approvals/ApprovalTests.cpp/blob/master/doc/SupportingNewTestFramework.md#top) and the UT reporter example (https://godbolt.org/z/gsAPKg). I made this simple example:
The issue is unless the line containing expect(true); is uncommented it doesn't work. It complains that currentTest was not configured. This seems more like a UT issue than an ApprovalTests issue.
Can anyone help? I'm not familiar enough with the UT code logic to track this issue. Or am I wrong and this is an ApprovalTests.cpp issue?
I appreciate any help.
The text was updated successfully, but these errors were encountered: