Expose ArgumentParserTestHelpers
Sorry if this is a very naive question or what I'm trying to do is already possible with the current package setup.
I find the ArgumentParserTestHelpers target very helpful and it would be great to be able to add it as a dependency for the client's testTarget.
As a test, I tried to simply add a product target for it in a fork.
Note below error was solved by @KS1019's suggestion
However, I keep getting the following error:
product 'ArgumentParserTestHelpers' required by package 'MyApp' target 'MayAppTests' not found in package 'swift-argument-parser'.
(Here is a sample reproducing this error)
Best regards,
Martin
My understanding is that it is not possible with the current setup of this project.
There have been similar issues from time to time like this one #255. I remember seeing @natecook1000 commenting they're not doing it because they cannot promise it will be maintained appropriately (but I couldn't find that particular issue so I'm not sure).
On the other hand, #255 is labeled as enhancement so maybe they are thinking of doing this.
cc @natecook1000 @rauhul Any clarification is much appreciated!
@KS1019 thank you for the details!
commenting they're not doing it because they cannot promise it will be maintained appropriately
I think I found this issue here: #303
Understood, I agree that guaranteeing maintainability is not really high priority for test helpers.
If it's something worthwhile, I'd love to help out in whatever capacity I can here.
However I seem to still fail at the basic understanding of why my sample is not finding the product even if I declare it in Package.swift. 😓
@MartinP7r I'm not too sure but you might want to modify [email protected] too.
@MartinP7r I'm not too sure but you might want to modify [email protected] too.
Oh, wow. Thanks so much.
I didn't know there's a way to specify a Package.swift for different swift versions. (If that's what's happening here)
👋🏻 We're definitely open to making ArgumentParserTestHelpers an exported target, but it really needs an API review before we're ready to do that, as it's mostly grown organically to support the specific kinds of tests that the library needs.
@MartinP7r, what parts are you finding useful?
Thank you for your time @natecook1000 👋🏼
AssertExecuteCommand is very useful.
I think the way you test the examples would naturally fit most apps that depend on ArgumentParser because integration testing is most practical for CLI tools of average size.