approvals / ApprovalTests.cpp

Native ApprovalTests for C++ on Linux, Mac and Windows
https://approvaltestscpp.readthedocs.io/en/latest/
Apache License 2.0
312 stars 51 forks source link

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

Open claremacrae opened 3 years ago

claremacrae commented 3 years ago

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 commented 3 years ago

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

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 commented 3 years ago

(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 commented 2 years ago

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...

claremacrae commented 2 years ago

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 commented 2 years ago

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