Closed claremacrae closed 4 years ago
This would be trivial to implement now... all the pieces are in place.
The DiffInfo args are now honoured... the new code would look something like this - but with the arguments
parameters added...:
namespace Mac {
APPROVAL_TESTS_MACROS_ENTRY(SUBLIME_MERGE,
DiffInfo("/Applications/Sublime Merge.app/Contents/SharedSupport/bin/smerge", Type::TEXT))
}
namespace Linux {
APPROVAL_TESTS_MACROS_ENTRY(SUBLIME_MERGE, DiffInfo("smerge", Type::TEXT))
}
namespace Windows {
APPROVAL_TESTS_MACROS_ENTRY(SUBLIME_MERGE, DiffInfo("{ProgramFiles}Sublime Merge\\smerge.exe", Type::TEXT))
}
....
class SublimeMergeReporter : public GenericDiffReporter
{
public:
SublimeMergeReporter()
: GenericDiffReporter(DiffPrograms::Mac::SUBLIME_MERGE())
{
launcher.setForeground(true);
}
};
Note the call to launcher.setForeground(true);
- which prevents the command from being launched in the background...
@jwillikers I'd really appreciate a Pull Request, if you were able to test the above - assuming it makes sense...
Entirely optional, of course.... 😀
@claremacrae I'd love too! I will later today. The only caveat I have to add is that the Snap version will use the name sublime_merge
and the Flatpak com.sublimemerge.App
. I also know that Snaps run on macOS as well as Linux.
Thanks @jwillikers ! 🙏
I’m not familiar with Snap and Flatpak - but definitely don’t feel constrained to stick with the current layers of implementation if it is easier to assemble the info differently, to support multiple possible paths.
Also, if for example you have multiple different paths to specify, maybe FirstWorkingReporter could gain a new constructor that took a container of DiffInfos... just a wild idea... no idea if you need it!
This requires #98 to be implemented first.
For required command-line arguments, see #43 - which are used in https://github.com/approvals/ApprovalTests.cpp/blob/master/doc/how_tos/UseACustomReporter.md#top