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

Remove the need for out-of-source build trees with non-Unity Ninja builds #171

Closed
claremacrae opened this issue Feb 13, 2021 · 3 comments
Closed

Comments

@claremacrae
Copy link
Collaborator

In a project where I'm using ApprovalTests, and I'm out-of-source builds so that Ninja CI builds should work, I'm finding that the compile-time error check is being triggered...

https://github.com/approvals/ApprovalTests.cpp/blob/master/doc/TroubleshootingMisconfiguredBuild.md#compilation-error

... I expected this Ninja build to work, because I'm doing out-of-source builds...

It's happened in one project where I'm loading the ApprovalTests.cpp project via CMake's FetchContent - so even though the build tree is outside the source directory, FetchContent is putting ApprovalTests inside the build-tree - which I think is resulting in relative paths...

This is another situation:

claremacrae/ApprovalTests.cpp.CMakeSamples#5

@claremacrae
Copy link
Collaborator Author

Because of this issue, I've experiment with adding some code to ApprovalTests::TestName::setFileName() so that, if it finds that the supplied source file does not exist, it tries looking in the parent dir, the grandparent dir, and a few more....

And if it finds the source file there, it remembers the amount of "../" that it needed to add, and uses that in the remaining tests in that test suite run.

The code is a bit ugly at the moment - but it's a big improvement in behaviour, as we would be able to get rid of most or all of this Troubleshooting page, for newer releases: https://github.com/approvals/ApprovalTests.cpp/blob/master/doc/TroubleshootingMisconfiguredBuild.md

.... and we would also get rid of the compile-time check as to whether the build was configured correctly...

@claremacrae
Copy link
Collaborator Author

The code so far is here - it runs on all CI platforms...

a11ccaa...a2b0081

Things that definitely need to be done:

@claremacrae
Copy link
Collaborator Author

This is fixed in the soon-to-be-released v.10.8.0

claremacrae added a commit that referenced this issue Feb 15, 2021
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

No branches or pull requests

1 participant