apple / apple/swift-argument-parser

Expose ArgumentParserTestHelpers

Open
#491 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
Swift
Stars
3.8k
Forks
411
Avg merge
7d 13h
Merged PRs (30d)
17

Description

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](https://github.com/MartinP7r/swift-argument-parser/blob/5936daea708194917d65020187febe402e40c954/Package.swift#L21-L23).

---

> **Note**
> below error was solved by @KS1019's [suggestion](https://github.com/apple/swift-argument-parser/issues/491#issuecomment-1257397121)

However, I keep getting the following error:

```console
product 'ArgumentParserTestHelpers' required by package 'MyApp' target 'MayAppTests' not found in package 'swift-argument-parser'.
```
([Here](https://github.com/MartinP7r/sap-test) is a sample reproducing this error)

---

Best regards,
Martin

Contributor guide

Open the contributing guide

Research direction

Start with Package.swift around the product target at lines 21–23 and compare it with the dependency declaration in the linked sap-test reproduction. Check how ArgumentParserTestHelpers is declared and exposed to a client testTarget. Done means a client can depend on the product without the reported “product ... not found” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
cli, testing
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.