<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 26, 2017 at 6:37 AM, thislooksfun via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I still much prefer &#39;testDependencies/Targets&#39;. You seem to be confusing this proposal with the (already accepted) <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0146-package-manager-product-definitions.md" target="_blank">Package Manager Product Definitions</a> proposal.<div>This proposal is strictly for running under `swift test`. The issue currently is that running any swift command (specifically anything that ends up calling `swift build`), will attempt to build testing libraries / targets, which then fail because they rely on XCTest, which is only available for import when running `swift test`. The idea here is that the libraries / targets will <b><i>only</i></b> be compiled when running in a testing environment, without having to manually switch out Package.swift files.<br><div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><br></div></div></div></div></blockquote><div><br></div><div>The test targets are *not* compiled when you run swift build. They&#39;re only complied on invocation of `swift test`. If a test target depends on a testing library (as in my example), they will *not* be built on invocation of `swift build`.</div><div><br></div><div>Also, you can import XCTest from your regular targets but that code will only run from a test target. (see TestSupport module in SwiftPM).</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">-thislooksfun (tlf)</div>

</div>
<br><div><blockquote type="cite"><div><div class="m_-7562369040094513319h5"><div>On Jan 25, 2017, at 2:07 AM, Ankit Aggarwal via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_-7562369040094513319m_-3199922143556806106Apple-interchange-newline"></div></div><div><div><div class="m_-7562369040094513319h5"><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><blockquote type="cite"><div><br class="m_-7562369040094513319m_-3199922143556806106Apple-interchange-newline">On 25-Jan-2017, at 4:02 AM, Robert Widmann via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_-7562369040094513319m_-3199922143556806106Apple-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-right:0px;margin-bottom:16px;margin-left:0px;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,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;background-color:rgb(255,255,255);margin-top:0px!important">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,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;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,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;background-color:rgb(255,255,255)"><a id="m_-7562369040094513319m_-3199922143556806106user-content-introduction" class="m_-7562369040094513319m_-3199922143556806106anchor" 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,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;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,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;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,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;background-color:rgb(255,255,255)"><a id="m_-7562369040094513319m_-3199922143556806106user-content-motivation" class="m_-7562369040094513319m_-3199922143556806106anchor" 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,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;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,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;background-color:rgb(255,255,255)"><a id="m_-7562369040094513319m_-3199922143556806106user-content-proposed-solution" class="m_-7562369040094513319m_-3199922143556806106anchor" 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,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;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,&#39;Liberation Mono&#39;,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,&#39;Liberation Mono&#39;,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,&#39;Liberation Mono&#39;,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,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;background-color:rgb(255,255,255)"><a id="m_-7562369040094513319m_-3199922143556806106user-content-detailed-design" class="m_-7562369040094513319m_-3199922143556806106anchor" 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,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;font-size:16px;background-color:rgb(255,255,255)">The behavior of the new <code style="box-sizing:border-box;font-family:Consolas,&#39;Liberation Mono&#39;,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,&#39;Liberation Mono&#39;,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> paramete<wbr>r 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,&#39;Liberation Mono&#39;,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="m_-7562369040094513319m_-3199922143556806106highlight m_-7562369040094513319m_-3199922143556806106highlight-source-swift" style="box-sizing:border-box;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,BlinkMacSystemFont,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;font-size:16px;background-color:rgb(255,255,255)"><pre style="box-sizing:border-box;font-family:Consolas,&#39;Liberation Mono&#39;,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="m_-7562369040094513319m_-3199922143556806106pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">import</span> <span class="m_-7562369040094513319m_-3199922143556806106pl-en" style="box-sizing:border-box;color:rgb(121,93,163)">PackageDescription</span>

<span class="m_-7562369040094513319m_-3199922143556806106pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">let</span> package <span class="m_-7562369040094513319m_-3199922143556806106pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Package</span>(
    <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">name</span>: <span class="m_-7562369040094513319m_-3199922143556806106pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span>Foo<span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span></span>,
    <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">targets</span>: [
        <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Target</span>(<span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">name</span>: <span class="m_-7562369040094513319m_-3199922143556806106pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span>Foo<span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span></span>)
    ],
    <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">dependencies</span>: [
        .<span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Package</span>(<span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">url</span>: <span class="m_-7562369040094513319m_-3199922143556806106pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span><a href="https://github.com/org/ana.git" target="_blank">https://github.com/org/ana.gi<wbr>t</a><span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span></span>, <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">versions</span>: <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Version</span>(<span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">1</span>,<span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">0</span>,<span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">0</span>)<span class="m_-7562369040094513319m_-3199922143556806106pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">...</span><span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Version</span>(<span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">1</span>,<span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">9</span>,<span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">9</span><wbr>)),
    ],
    <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">testDependencies</span>: [
        .<span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Package</span>(<span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">url</span>: <span class="m_-7562369040094513319m_-3199922143556806106pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span><a href="https://github.com/org/anism.git" target="_blank">https://github.com/org/anism.<wbr>git</a><span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span></span>, <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">versions</span>: <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Version</span>(<span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">1</span>,<span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">0</span>,<span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">0</span>)<span class="m_-7562369040094513319m_-3199922143556806106pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">...</span><span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Version</span>(<span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">1</span>,<span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">9</span>,<span class="m_-7562369040094513319m_-3199922143556806106pl-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&#39;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&#39;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="m_-7562369040094513319m_-3199922143556806106language-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,&#39;Andale Mono&#39;,&#39;Ubuntu Mono&#39;,monospace;word-break:normal;word-wrap:normal"><code class="m_-7562369040094513319m_-3199922143556806106language-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,&#39;Andale Mono&#39;,&#39;Ubuntu Mono&#39;,monospace;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5"><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106keyword" style="color:rgb(0,119,170)">let</span> package <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106operator" style="color:rgb(166,127,89);background-color:rgba(255,255,255,0.498039)">=</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106function" style="color:rgb(221,74,104)">Package</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">(</span>
    name<span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">:</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106string" style="color:rgb(102,153,0)">&quot;FooNetworking&quot;</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">,</span>
    targets<span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">:</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">[</span>
        <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106function" style="color:rgb(221,74,104)">Target</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">(</span>
            name<span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">:</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106string" style="color:rgb(102,153,0)">&quot;FooNetworking&quot;</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">)</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">,</span>
        <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106function" style="color:rgb(221,74,104)">Target</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">(</span>
            name<span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">:</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106string" style="color:rgb(102,153,0)">&quot;FooNetworkingExample&quot;</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">,</span>
            dependencies<span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">:</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">[</span>
                <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106string" style="color:rgb(102,153,0)">&quot;FooNetworking&quot;</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">,</span> 
                <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">.</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106function" style="color:rgb(221,74,104)">package</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">(</span>url<span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">:</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106string" style="color:rgb(102,153,0)">&quot;/path/to/BarJSON.git&quot;</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">,</span> version<span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">:</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106string" style="color:rgb(102,153,0)">&quot;1.0.0&quot;</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">,</span> product<span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">:</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106string" style="color:rgb(102,153,0)">&quot;BarJSON&quot;</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">)</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">,</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106comment" style="color:rgb(112,128,144)">// Note: This doesn&#39;t actually exists right now.</span>
            <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">]</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">)</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">,</span>
        <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106function" style="color:rgb(221,74,104)">Target</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">(</span>
            name<span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">:</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106string" style="color:rgb(102,153,0)">&quot;FooNetworkingTests&quot;</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">,</span>
            dependencies<span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">:</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">[</span>
                <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106string" style="color:rgb(102,153,0)">&quot;FooNetworking&quot;</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">,</span> 
                <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">.</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106function" style="color:rgb(221,74,104)">package</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">(</span>url<span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">:</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106string" style="color:rgb(102,153,0)">&quot;/path/to/Quick.git&quot;</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">,</span> version<span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">:</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106string" style="color:rgb(102,153,0)">&quot;1.0.0&quot;</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">,</span> product<span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">:</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106string" style="color:rgb(102,153,0)">&quot;Quick&quot;</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">)</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">,</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106comment" style="color:rgb(112,128,144)">// Note: This doesn&#39;t actually exists right now.</span>
            <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">]</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">)</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">,</span>
   <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">]</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">,</span>
   products<span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">:</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">[</span>
       <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">.</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106function" style="color:rgb(221,74,104)">Library</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">(</span>name<span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">:</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106string" style="color:rgb(102,153,0)">&quot;FooNetworking&quot;</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">,</span> targets<span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">:</span> <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">[</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106string" style="color:rgb(102,153,0)">&quot;FooNetworking&quot;</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">]</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">)</span><span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">,</span>
   <span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" style="color:rgb(153,153,153)">]</span>
<span class="m_-7562369040094513319m_-3199922143556806106token m_-7562369040094513319m_-3199922143556806106punctuation" 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<span class="m_-7562369040094513319m_-3199922143556806106Apple-converted-space"> </span><b>FooNetworking</b><span class="m_-7562369040094513319m_-3199922143556806106Apple-converted-space"> </span>target and<span class="m_-7562369040094513319m_-3199922143556806106Apple-converted-space"> </span><b>BarJSON</b><span class="m_-7562369040094513319m_-3199922143556806106Apple-converted-space"> </span>product from an external package.<br><b>FooNetworkingTests</b>: The test target depends on an external package<span class="m_-7562369040094513319m_-3199922143556806106Apple-converted-space"> </span><b>Quick</b>.<br><br>Both<span class="m_-7562369040094513319m_-3199922143556806106Apple-converted-space"> </span><b>BarJSON</b><span class="m_-7562369040094513319m_-3199922143556806106Apple-converted-space"> </span>and<span class="m_-7562369040094513319m_-3199922143556806106Apple-converted-space"> </span><b>Quick</b><span class="m_-7562369040094513319m_-3199922143556806106Apple-converted-space"> </span>are local dependencies to this package. If<span class="m_-7562369040094513319m_-3199922143556806106Apple-converted-space"> </span><b>FooNetworkingExample</b><span class="m_-7562369040094513319m_-3199922143556806106Apple-converted-space"> </span>was also vended as a product,<span class="m_-7562369040094513319m_-3199922143556806106Apple-converted-space"> </span><b>BarJSON</b><span class="m_-7562369040094513319m_-3199922143556806106Apple-converted-space"> </span>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,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;font-size:16px;background-color:rgb(255,255,255)">Similarly, the behavior of the <code style="box-sizing:border-box;font-family:Consolas,&#39;Liberation Mono&#39;,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,&#39;Liberation Mono&#39;,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,&#39;Liberation Mono&#39;,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,&#39;Liberation Mono&#39;,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,&#39;Liberation Mono&#39;,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="m_-7562369040094513319m_-3199922143556806106highlight m_-7562369040094513319m_-3199922143556806106highlight-source-swift" style="box-sizing:border-box;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,BlinkMacSystemFont,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;font-size:16px;background-color:rgb(255,255,255)"><pre style="box-sizing:border-box;font-family:Consolas,&#39;Liberation Mono&#39;,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="m_-7562369040094513319m_-3199922143556806106pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">import</span> <span class="m_-7562369040094513319m_-3199922143556806106pl-en" style="box-sizing:border-box;color:rgb(121,93,163)">PackageDescription</span>

<span class="m_-7562369040094513319m_-3199922143556806106pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">let</span> package <span class="m_-7562369040094513319m_-3199922143556806106pl-k" style="box-sizing:border-box;color:rgb(167,29,93)">=</span> <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Package</span>(
    <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">name</span>: <span class="m_-7562369040094513319m_-3199922143556806106pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span>SwiftPM<span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span></span>,
    <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">targets</span>: [
        <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Target</span>(
            <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">name</span>: <span class="m_-7562369040094513319m_-3199922143556806106pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span>PackageDescription<span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span></span>,
            <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">dependencies</span>: []),

        <span class="m_-7562369040094513319m_-3199922143556806106pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="m_-7562369040094513319m_-3199922143556806106pl-c" style="box-sizing:border-box">//</span> MARK: Support libraries</span>
<span class="m_-7562369040094513319m_-3199922143556806106pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"></span>
        <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Target</span>(
            <span class="m_-7562369040094513319m_-3199922143556806106pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="m_-7562369040094513319m_-3199922143556806106pl-c" style="box-sizing:border-box">/**</span> Cross-platform access to bare `libc` functionality. <span class="m_-7562369040094513319m_-3199922143556806106pl-c" style="box-sizing:border-box">*/</span></span>
            <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">name</span>: <span class="m_-7562369040094513319m_-3199922143556806106pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span>libc<span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span></span>,
            <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">dependencies</span>: []),
        <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Target</span>(
            <span class="m_-7562369040094513319m_-3199922143556806106pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="m_-7562369040094513319m_-3199922143556806106pl-c" style="box-sizing:border-box">/**</span> “Swifty” POSIX functions from libc <span class="m_-7562369040094513319m_-3199922143556806106pl-c" style="box-sizing:border-box">*/</span></span>
            <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">name</span>: <span class="m_-7562369040094513319m_-3199922143556806106pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span>POSIX<span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span></span>,
            <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">dependencies</span>: [<span class="m_-7562369040094513319m_-3199922143556806106pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span>libc<span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span></span>]),
        <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Target</span>(
            <span class="m_-7562369040094513319m_-3199922143556806106pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="m_-7562369040094513319m_-3199922143556806106pl-c" style="box-sizing:border-box">/**</span> Basic support library <span class="m_-7562369040094513319m_-3199922143556806106pl-c" style="box-sizing:border-box">*/</span></span>
            <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">name</span>: <span class="m_-7562369040094513319m_-3199922143556806106pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span>Basic<span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span></span>,
            <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">dependencies</span>: [<span class="m_-7562369040094513319m_-3199922143556806106pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span>libc<span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span></span>, <span class="m_-7562369040094513319m_-3199922143556806106pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span>POSIX<span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span></span>]),

        <span class="m_-7562369040094513319m_-3199922143556806106pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="m_-7562369040094513319m_-3199922143556806106pl-c" style="box-sizing:border-box">/*</span> Omitted for Brevity <span class="m_-7562369040094513319m_-3199922143556806106pl-c" style="box-sizing:border-box">*/</span></span>
     ],
     <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">testTargets</span>: [
        <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">Target</span>(
            <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">name</span>: <span class="m_-7562369040094513319m_-3199922143556806106pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span>BasicPerformanceTests<span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span></span>,
            <span class="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">dependencies</span>: [<span class="m_-7562369040094513319m_-3199922143556806106pl-s" style="box-sizing:border-box;color:rgb(24,54,145)"><span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span>Basic<span class="m_-7562369040094513319m_-3199922143556806106pl-pds" style="box-sizing:border-box">&quot;</span></span>]),
       <span class="m_-7562369040094513319m_-3199922143556806106pl-c" style="box-sizing:border-box;color:rgb(150,152,150)"><span class="m_-7562369040094513319m_-3199922143556806106pl-c" style="box-sizing:border-box">/*</span> Omitted for Brevity <span class="m_-7562369040094513319m_-3199922143556806106pl-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,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;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,&#39;Liberation Mono&#39;,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,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;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="m_-7562369040094513319m_-3199922143556806106highlight m_-7562369040094513319m_-3199922143556806106highlight-source-shell" style="box-sizing:border-box;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,BlinkMacSystemFont,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;font-size:16px;background-color:rgb(255,255,255)"><pre style="box-sizing:border-box;font-family:Consolas,&#39;Liberation Mono&#39;,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="m_-7562369040094513319m_-3199922143556806106pl-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,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;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,&#39;Liberation Mono&#39;,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="m_-7562369040094513319m_-3199922143556806106highlight m_-7562369040094513319m_-3199922143556806106highlight-source-shell" style="box-sizing:border-box;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,BlinkMacSystemFont,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;font-size:16px;background-color:rgb(255,255,255)"><pre style="box-sizing:border-box;font-family:Consolas,&#39;Liberation Mono&#39;,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="m_-7562369040094513319m_-3199922143556806106pl-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,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;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="m_-7562369040094513319m_-3199922143556806106highlight m_-7562369040094513319m_-3199922143556806106highlight-source-shell" style="box-sizing:border-box;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,BlinkMacSystemFont,&#39;Segoe UI&#39;,Helvetica,Arial,sans-serif,&#39;Apple Color Emoji&#39;,&#39;Segoe UI Emoji&#39;,&#39;Segoe UI Symbol&#39;;font-size:16px;background-color:rgb(255,255,255)"><pre style="box-sizing:border-box;font-family:Consolas,&#39;Liberation Mono&#39;,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="m_-7562369040094513319m_-3199922143556806106pl-c1" style="box-sizing:border-box;color:rgb(0,134,179)">test</span> TestModule.TestCase.exampleTes<wbr>t</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<span class="m_-7562369040094513319m_-3199922143556806106Apple-converted-space"> </span><b>Tests<span class="m_-7562369040094513319m_-3199922143556806106Apple-converted-space"> </span></b>and is placed under<span class="m_-7562369040094513319m_-3199922143556806106Apple-converted-space"> </span><b>Tests/<span class="m_-7562369040094513319m_-3199922143556806106Apple-converted-space"> </span></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 style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Here is a summary of what `swift test` currently supports:</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">* Test targets are only built (and run) when you run `swift test`.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">* `swift test --skip-build` skips building of test targets and runs whatever was last built.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">* `swift test -s &lt;test-module&gt;.&lt;test-case&gt;` will run a test case class.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">* `swift test -s &lt;test-module&gt;.&lt;test-case&gt;/&lt;tes<wbr>t&gt;` will run an individual test.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">* `swift test --list-tests` will list all tests in above format.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">* `swift test --parallel` will run tests in parallel.</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">You can view these options and their help text using `swift test --help`.</div><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"></div></div><span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">______________________________<wbr>_________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">swift-evolution mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="mailto:swift-evolution@swift.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">swift-evolution@swift.org</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-evolution</a></span></div></blockquote></div><br></div></div><br>______________________________<wbr>_________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-evolution</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_-7562369040094513319gmail_signature" data-smartmail="gmail_signature">Ankit<br><br></div>
</div></div>