<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 26, 2017 at 1:55 PM, Robert Widmann via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><div>Three parts for three points:</div><div id="gmail-m_1649803439126751658AppleMailSignature"><br></div><div id="gmail-m_1649803439126751658AppleMailSignature">1) Thanks!</div><div id="gmail-m_1649803439126751658AppleMailSignature"><br></div><div id="gmail-m_1649803439126751658AppleMailSignature">2) I'm not sure generalizing this is particularly useful post-products. The larger point is not to have non-exported/local target dependencies but to make clear the divide between a package and its test suite in the manifest as well as on disk. Local dependencies seem like a separate proposal entirely.</div></div></blockquote><div><br></div><div>We do have a clear divide between normal modules and test modules. </div><div>I am not sure adding a special case test dependencies makes sense right now. We might end up having conditional dependencies later w.r.t platform and other parameters.</div><div><br></div><div>Daniel, do you want to pitch in? </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="auto"><div id="gmail-m_1649803439126751658AppleMailSignature"></div><div id="gmail-m_1649803439126751658AppleMailSignature">3) Wow, I honestly should have noticed this: I took the time to peruse the source for the help text and still managed to miss it. It has been struck from the gist of this proposal.<br><br>~Robert Widmann</div><div><br>2017/01/25 3:07、Ankit Aggarwal <<a href="mailto:ankit_aggarwal@apple.com" target="_blank">ankit_aggarwal@apple.com</a>> のメッセージ:<br><br></div><div><div class="gmail-h5"><blockquote type="cite"><div><br><div><blockquote type="cite"><div>On 25-Jan-2017, at 4:02 AM, Robert Widmann via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br class="gmail-m_1649803439126751658Apple-interchange-newline"><div><div style="word-wrap:break-word">Hello Swift Community,<div><br></div><div>Harlan Haskins and I have been <a href="https://github.com/trill-lang" target="_blank">working on libraries</a> to make interacting with LLVM and Clang’s APIs more elegant with native Swift interfaces. While writing up the packages we realized the package manager wouldn’t allow us to specify testing targets and test-only dependencies. To rectify that, I have attached a draft proposal for adding test-only targets and dependency fields to the Swift Package manager. This proposal can also be read <a href="https://gist.github.com/CodaFi/6bd83e5315c7d30aeaf4154ed3b03a38" target="_blank">in gist form</a>.</div><div><br></div><div>Cheers,</div><div><br></div><div>~Robert Widmann</div><div><br></div></div></div></blockquote><div><br></div><div>Thanks for driving this! It is a very desirable feature which needs proposal work. Comments inline.</div><div><br></div><div><br></div><br><blockquote type="cite"><div><div style="word-wrap:break-word"><div><h1 style="box-sizing:border-box;margin:0px 0px 16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';background-color:rgb(255,255,255)">Test-Only Package Dependencies and Targets</h1><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px;background-color:rgb(255,255,255)"><li style="box-sizing:border-box">Proposal: <a href="https://gist.github.com/CodaFi/NNNN-filename.md" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none" target="_blank">SE-NNNN</a></li><li style="box-sizing:border-box;margin-top:0.25em">Authors: <a href="https://github.com/harlanhaskins" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none" target="_blank">Harlan Haskins</a>, <a href="https://github.com/codafi" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none" target="_blank">Robert Widmann</a></li><li style="box-sizing:border-box;margin-top:0.25em">Review Manager: TBD</li><li style="box-sizing:border-box;margin-top:0.25em">Status: <span style="box-sizing:border-box;font-weight:600">Awaiting review</span></li></ul><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';background-color:rgb(255,255,255)"><a id="gmail-m_1649803439126751658user-content-introduction" class="gmail-m_1649803439126751658anchor" href="https://gist.github.com/CodaFi/6bd83e5315c7d30aeaf4154ed3b03a38#introduction" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1" target="_blank"><u></u><u></u><u></u><u></u></a>Introduction</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px;background-color:rgb(255,255,255)">This proposal reinstates Swift package manager’s ability to fetch dependencies and build targets scoped exclusively to the testing module(s) of a given package.</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px;background-color:rgb(255,255,255)">Swift-evolution thread: <a href="https://lists.swift.org/pipermail/swift-evolution/" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none" target="_blank">Discussion thread topic for that proposal</a></p><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';background-color:rgb(255,255,255)"><a id="gmail-m_1649803439126751658user-content-motivation" class="gmail-m_1649803439126751658anchor" href="https://gist.github.com/CodaFi/6bd83e5315c7d30aeaf4154ed3b03a38#motivation" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1" target="_blank"><u></u><u></u><u></u><u></u></a>Motivation</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px;background-color:rgb(255,255,255)">Soon after <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0019-package-manager-testing.md#test-only-dependencies" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none" target="_blank">SE-0019</a> identified the need for richer test-only dependencies and targets, a decision was made to remove the package manager’s fledgling ability to treat certain dependencies as test-only. This has led to a myriad of clever-but-needlessly-complex workarounds (<a href="https://github.com/ReactiveCocoa/ReactiveSwift/blob/master/.travis.yml#L85" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none" target="_blank">[1]</a>, <a href="https://github.com/ReactiveX/RxSwift/blob/master/Package.swift#L3" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none" target="_blank">[2]</a>, <a href="https://github.com/Quick/Quick/blob/master/.Package.test.swift" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none" target="_blank">[3]</a>) on the part of 3rd parties to recover the feature themselves. In addition, the Swift community has come up with a number of their own frameworks to augment functionality in XCTest but depending on these external testing frameworks is brittle and difficult to get right.</p><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';background-color:rgb(255,255,255)"><a id="gmail-m_1649803439126751658user-content-proposed-solution" class="gmail-m_1649803439126751658anchor" href="https://gist.github.com/CodaFi/6bd83e5315c7d30aeaf4154ed3b03a38#proposed-solution" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1" target="_blank"><u></u><u></u><u></u><u></u></a>Proposed solution</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px;background-color:rgb(255,255,255)">We propose the re-introduction of the <code style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">testDependencies</code> parameter in Package Manifests to support external test-only dependencies. To support local test-only targets we also propose the introduction of the <code style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">testTargets</code> parameter and an extension of the existing <code style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">swift test</code> command to support individual invocation of these targets.</p><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';background-color:rgb(255,255,255)"><a id="gmail-m_1649803439126751658user-content-detailed-design" class="gmail-m_1649803439126751658anchor" href="https://gist.github.com/CodaFi/6bd83e5315c7d30aeaf4154ed3b03a38#detailed-design" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1" target="_blank"><u></u><u></u><u></u><u></u></a>Detailed design</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px;background-color:rgb(255,255,255)">The behavior of the new <code style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">testDependencies</code> parameter mirrors that of the existing <code style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">dependencies</code> <wbr>parameter with one important difference: fetched dependencies are only built to support package-defined test targets as part of an invocation of <code style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">swift test</code>.</p><div class="gmail-m_1649803439126751658highlight gmail-m_1649803439126751658highlight-source-swift" style="box-sizing:border-box;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px;background-color:rgb(255,255,255)"><pre style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;margin-top:0px;margin-bottom:0px;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal"><span class="gmail-m_1649803439126751658pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">import</span> <span class="gmail-m_1649803439126751658pl-en" style="box-sizing:border-box;color:rgb(121,93,163)">PackageDescription</span>
<span class="gmail-m_1649803439126751658pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">let</span> package <span class="gmail-m_1649803439126751658pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> <span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Package</span>(
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">name</span>: <span class="gmail-m_1649803439126751658pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span>Foo<span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span></span>,
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">targets</span>: [
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Target</span>(<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">name</span>: <span class="gmail-m_1649803439126751658pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span>Foo<span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span></span>)
],
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">dependencies</span>: [
.<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Package</span>(<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">url</span>: <span class="gmail-m_1649803439126751658pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span><a href="https://github.com/org/ana.git" target="_blank">https://github.com/org/ana.<wbr>git</a><span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span></span>, <span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">versions</span>: <span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Version</span>(<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">1</span>,<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">0</span>,<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">0</span>)<span class="gmail-m_1649803439126751658pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">...</span><span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Version</span>(<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">1</span>,<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">9</span>,<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">9</span><wbr>)),
],
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">testDependencies</span>: [
.<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Package</span>(<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">url</span>: <span class="gmail-m_1649803439126751658pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span><a href="https://github.com/org/anism.git" target="_blank">https://github.com/org/anism.<wbr>git</a><span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span></span>, <span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">versions</span>: <span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Version</span>(<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">1</span>,<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">0</span>,<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">0</span>)<span class="gmail-m_1649803439126751658pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">...</span><span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Version</span>(<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">1</span>,<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">9</span>,<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">9</span><wbr>)),
]
)</pre></div></div></div></div></blockquote><div><br></div><div>I think this feature should be called local dependencies (or maybe dev dependencies) because it can be used for tests as well as regular targets. </div><div>As an example say you have a networking library package and you want to create an example CLI target which uses a JSON mapper package. You wouldn't want to vend the CLI tool when you act as a dependency to other packages, or include the JSON mapper in your dependencies. Test dependency doesn't sound right in that context.</div><div><br></div><div>After the product <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0146-package-manager-product-definitions.md" target="_blank">proposal</a> is implemented, you will be able to control what you vend to your clients, and we thought about adding ability to define dependencies in-line with target dependencies but left it out of the proposal to keep it simpler. Maybe this proposal can add that instead of a separate `testDependencies` property. Consider this manifest:</div><div><br></div><div><pre class="gmail-m_1649803439126751658language-swift" style="margin-top:0.5em;margin-bottom:0.5em;background-color:rgb(245,242,240);border:1px solid rgb(204,204,204);font-size:13px;line-height:1.5;overflow:auto;padding:1em;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;font-family:consolas,monaco,'andale mono','ubuntu mono',monospace;word-break:normal;word-wrap:normal"><code class="gmail-m_1649803439126751658language-swift" style="margin:0px;padding:0px;border:none;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-image:none;font-family:consolas,monaco,'andale mono','ubuntu mono',monospace;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5"><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658keyword" style="color:rgb(0,119,170)">let</span> package <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658operator" style="color:rgb(166,127,89);background-color:rgba(255,255,255,0.498039)">=</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658function" style="color:rgb(221,74,104)">Package</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">(</span>
name<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">:</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658string" style="color:rgb(102,153,0)">"FooNetworking"</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">,</span>
targets<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">:</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">[</span>
<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658function" style="color:rgb(221,74,104)">Target</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">(</span>
name<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">:</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658string" style="color:rgb(102,153,0)">"FooNetworking"</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">)</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">,</span>
<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658function" style="color:rgb(221,74,104)">Target</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">(</span>
name<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">:</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658string" style="color:rgb(102,153,0)">"FooNetworkingExample"</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">,</span>
dependencies<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">:</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">[</span>
<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658string" style="color:rgb(102,153,0)">"FooNetworking"</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">,</span>
<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">.</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658function" style="color:rgb(221,74,104)">package</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">(</span>url<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">:</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658string" style="color:rgb(102,153,0)">"/path/to/BarJSON.git"</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">,</span> version<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">:</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658string" style="color:rgb(102,153,0)">"1.0.0"</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">,</span> product<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">:</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658string" style="color:rgb(102,153,0)">"BarJSON"</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">)</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">,</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658comment" style="color:rgb(112,128,144)">// Note: This doesn't actually exists right now.</span>
<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">]</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">)</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">,</span>
<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658function" style="color:rgb(221,74,104)">Target</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">(</span>
name<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">:</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658string" style="color:rgb(102,153,0)">"FooNetworkingTests"</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">,</span>
dependencies<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">:</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">[</span>
<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658string" style="color:rgb(102,153,0)">"FooNetworking"</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">,</span>
<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">.</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658function" style="color:rgb(221,74,104)">package</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">(</span>url<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">:</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658string" style="color:rgb(102,153,0)">"/path/to/Quick.git"</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">,</span> version<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">:</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658string" style="color:rgb(102,153,0)">"1.0.0"</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">,</span> product<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">:</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658string" style="color:rgb(102,153,0)">"Quick"</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">)</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">,</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658comment" style="color:rgb(112,128,144)">// Note: This doesn't actually exists right now.</span>
<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">]</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">)</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">,</span>
<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">]</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">,</span>
products<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">:</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">[</span>
<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">.</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658function" style="color:rgb(221,74,104)">Library</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">(</span>name<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">:</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658string" style="color:rgb(102,153,0)">"FooNetworking"</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">,</span> targets<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">:</span> <span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">[</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658string" style="color:rgb(102,153,0)">"FooNetworking"</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">]</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">)</span><span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">,</span>
<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">]</span>
<span class="gmail-m_1649803439126751658token gmail-m_1649803439126751658punctuation" style="color:rgb(153,153,153)">)</span></code></pre><div><br></div></div>This manifest defines three targets and one product.<br><br><b>FooNetworking</b>: The base target and the actual library.<br><b>FooNetworkingExample</b>: The example cli tool. It depends on <b>FooNetworking</b> target and <b>BarJSON</b> product from an external package.<br><b>FooNetworkingTests</b>: The test target depends on an external package <b>Quick</b>.<br><br>Both <b>BarJSON</b> and <b>Quick</b> are local dependencies to this package. If <b>FooNetworkingExample</b> was also vended as a product, <b>BarJSON</b> would automatically become a regular external dependency.<br><br><blockquote type="cite"><div><div style="word-wrap:break-word"><div><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px;background-color:rgb(255,255,255)">Similarly, the behavior of the <code style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">testTargets</code> field mirrors that of the existing <code style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">targets</code> field but defines a set of targets that are only built during an invocation of <code style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">swift test</code>. Importantly, a target defined in <code style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">testTargets</code> may reference a target defined in <code style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">targets</code> but not vice-versa. Should that behavior be needed, the test target should be promoted to a “full” target.</p><div class="gmail-m_1649803439126751658highlight gmail-m_1649803439126751658highlight-source-swift" style="box-sizing:border-box;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px;background-color:rgb(255,255,255)"><pre style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;margin-top:0px;margin-bottom:0px;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal"><span class="gmail-m_1649803439126751658pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">import</span> <span class="gmail-m_1649803439126751658pl-en" style="box-sizing:border-box;color:rgb(121,93,163)">PackageDescription</span>
<span class="gmail-m_1649803439126751658pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">let</span> package <span class="gmail-m_1649803439126751658pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> <span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Package</span>(
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">name</span>: <span class="gmail-m_1649803439126751658pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span>SwiftPM<span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span></span>,
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">targets</span>: [
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Target</span>(
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">name</span>: <span class="gmail-m_1649803439126751658pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span>PackageDescription<span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span></span>,
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">dependencies</span>: []),
<span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box">//</span> MARK: Support libraries</span>
<span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"></span>
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Target</span>(
<span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box">/**</span> Cross-platform access to bare `libc` functionality. <span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box">*/</span></span>
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">name</span>: <span class="gmail-m_1649803439126751658pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span>libc<span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span></span>,
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">dependencies</span>: []),
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Target</span>(
<span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box">/**</span> “Swifty” POSIX functions from libc <span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box">*/</span></span>
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">name</span>: <span class="gmail-m_1649803439126751658pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span>POSIX<span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span></span>,
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">dependencies</span>: [<span class="gmail-m_1649803439126751658pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span>libc<span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span></span>]),
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Target</span>(
<span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box">/**</span> Basic support library <span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box">*/</span></span>
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">name</span>: <span class="gmail-m_1649803439126751658pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span>Basic<span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span></span>,
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">dependencies</span>: [<span class="gmail-m_1649803439126751658pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span>libc<span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span></span>, <span class="gmail-m_1649803439126751658pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span>POSIX<span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span></span>]),
<span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box">/*</span> Omitted for Brevity <span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box">*/</span></span>
],
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">testTargets</span>: [
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Target</span>(
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">name</span>: <span class="gmail-m_1649803439126751658pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span>BasicPerformanceTests<span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span></span>,
<span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">dependencies</span>: [<span class="gmail-m_1649803439126751658pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span>Basic<span class="gmail-m_1649803439126751658pl-pds" style="box-sizing:border-box">"</span></span>]),
<span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box">/*</span> Omitted for Brevity <span class="gmail-m_1649803439126751658pl-c" style="box-sizing:border-box">*/</span></span>
]
)</pre></div><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px;background-color:rgb(255,255,255)">Finally, with well-defined test targets in hand, we propose <code style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">swift test</code> be amended to support individual test execution.</p><div><br></div><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px;background-color:rgb(255,255,255)">We propose the following syntax to execute all tests of all known test targets.</p><div class="gmail-m_1649803439126751658highlight gmail-m_1649803439126751658highlight-source-shell" style="box-sizing:border-box;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px;background-color:rgb(255,255,255)"><pre style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;margin-top:0px;margin-bottom:0px;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal">$ swift <span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">test</span></pre></div><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px;background-color:rgb(255,255,255)">To run a set of specific test cases, reference the module-defining test target and the specific name of a subclass of <code style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">XCTestCase</code>:</p><div class="gmail-m_1649803439126751658highlight gmail-m_1649803439126751658highlight-source-shell" style="box-sizing:border-box;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px;background-color:rgb(255,255,255)"><pre style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;margin-top:0px;margin-bottom:0px;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal">$ swift <span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">test</span> TestModule.TestCase</pre></div><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px;background-color:rgb(255,255,255)">To run an individual test case, reference the module-defining test target, the name of the test case subclass, and the name of the test:</p><div class="gmail-m_1649803439126751658highlight gmail-m_1649803439126751658highlight-source-shell" style="box-sizing:border-box;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px;background-color:rgb(255,255,255)"><pre style="box-sizing:border-box;font-family:consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;margin-top:0px;margin-bottom:0px;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal">$ swift <span class="gmail-m_1649803439126751658pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">test</span> TestModule.TestCase.<wbr>exampleTest</pre></div></div></div></div></blockquote><div><br></div>We already have all these features. A target is a test target if it has a suffix <b>Tests </b>and is placed under <b>Tests/ </b>directory — we might loosen these restrictions with custom target conventions feature. This <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0129-package-manager-test-naming-conventions.md" target="_blank">proposal</a> could clarify further.</div><div><br></div><div>Here is a summary of what `swift test` currently supports:</div><div>* Test targets are only built (and run) when you run `swift test`.</div><div>* `swift test --skip-build` skips building of test targets and runs whatever was last built.</div><div>* `swift test -s <test-module>.<test-case>` will run a test case class.</div><div>* `swift test -s <test-module>.<test-case>/<<wbr>test>` will run an individual test.</div><div>* `swift test --list-tests` will list all tests in above format.</div><div>* `swift test --parallel` will run tests in parallel.</div><div><br></div><div>You can view these options and their help text using `swift test --help`.</div><br></div></blockquote></div></div></div><br>______________________________<wbr>_________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Ankit<br><br></div>
</div></div>