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

Ampersand Operator in ut test framework #157

Open
mgnisia opened this issue Sep 22, 2020 · 7 comments
Open

Ampersand Operator in ut test framework #157

mgnisia opened this issue Sep 22, 2020 · 7 comments

Comments

@mgnisia
Copy link

mgnisia commented Sep 22, 2020

Problem Description

If one uses the ampersand operator like

"example"_test = [&] {
// do some tests
}

This causes that the approval tests files can not be found.

Example Repository: https://github.com/mgnisia/ut-approvaltests-example

Proposed (easy) Solution

  1. Update Documentation for UT: Add this as a special case.
  2. Remove Ampersand in test
@claremacrae
Copy link
Collaborator

Thank you for reporting the issue.

Approval Tests depends on the underlying test framework to report the name of the source file. So for some reason, when [&] is used, the file name isn't captured.

I started reporting this as a Boost.ut bug and then realised that it would be worth first testing this out with the latest release of Boost.ut...

If you have had time to do that and note here what happened, that would be really helpful...

@mgnisia
Copy link
Author

mgnisia commented Sep 22, 2020

Thats good to know 👍 Currently I am using the latest release and appears there as well. I am finished with my master thesis in November, if this bug is not fixed until then, I can have a look then :)

@mgnisia mgnisia changed the title Ampersand Operator in UT Test Ampersand Operator in ut test framework Sep 22, 2020
@claremacrae
Copy link
Collaborator

OK that's helpful - thank you. If I get time, I'll try looking at this before then - most likely reporting it as a bug in Boost.ut

Good luck with your thesis @mgnisia !

@claremacrae
Copy link
Collaborator

I have logged this issue in the boost.ut project: boost-ext/ut#434

@sam20908
Copy link

This commit addresses the issue with MSVC (and possibly other compilers? Will need testing) boost-ext/ut@76e2f56.

@claremacrae
Copy link
Collaborator

@sam20908 Hi Sam, thanks very much for looking at this..

I checked the Compiler Explorer link that I put in to that boost.ut issue, and the failing test there is still failing, so unfortunately I think there's still a problem...

https://godbolt.org/z/13Y7Wq1r7

@claremacrae
Copy link
Collaborator

This is on-hold until the upstream bug is fixed, at which point our CI will alert us

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants