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

When creating new approved files, of non-text types, try to make them valid empty files #172

Open
claremacrae opened this issue Feb 17, 2021 · 5 comments

Comments

@claremacrae
Copy link
Collaborator

claremacrae commented Feb 17, 2021

Add integration with Simon Cropp's EmptyFiles tool - see https://github.com/VerifyTests/EmptyFiles#tool-usage

We would have to work out the mechanics of this.

@claremacrae
Copy link
Collaborator Author

claremacrae commented Feb 17, 2021

Since we don't have an installer mechanism, there's a variety of ways that users can obtain ApprovalTests.cpp, including:

  • via downloading the single header
  • via any package managers
  • git sub-repo or similar
  • CMake's FetchContent

So I think we'll have to train users to install the EmptyFiles tool themselves... (and install dotnet - which won't be standard for pure C++ projects...)

@claremacrae
Copy link
Collaborator Author

(and install dotnet - which won't be standard for pure C++ projects...)

Simon Cropp pointed to that it's possible to make dotnet exes standalone, so the above wouldn't be needed...
https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file

@claremacrae
Copy link
Collaborator Author

Idea: we could create a seam to generate empty files - and if it detects that empty-file is present, it runs it...
We could make the seam, and make it pluggable, and then pick it up later...

isidore added a commit that referenced this issue Aug 30, 2021
Co-Authored-By: Clare Macrae <github@cfmacrae.fastmail.co.uk>
isidore added a commit that referenced this issue Aug 30, 2021
Co-Authored-By: Clare Macrae <github@cfmacrae.fastmail.co.uk>
@claremacrae
Copy link
Collaborator Author

claremacrae commented Aug 30, 2021

The seam/customization point for controlling how new files are created is documented here:

https://github.com/approvals/ApprovalTests.cpp/blob/master/doc/Writers.md#empty-files

@claremacrae
Copy link
Collaborator Author

There is a simpler seam now, that works well for individual file extensions:
https://github.com/approvals/ApprovalTests.cpp/blob/master/doc/Writers.md#customizing-by-file-extension

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

2 participants