<div id="compose" contenteditable="true" style="padding-left: 20px; padding-right: 20px; padding-bottom: 8px;"><div>I sent up another attempt for this: <a dir="ltr" href="https://github.com/apple/swift-corelibs-xctest/pull/10" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="0">https://github.com/apple/swift-corelibs-xctest/pull/10</a></div><div><br></div><div>Based on the discussion in that pull request, I'm now exploring using lit to test the XCTest output. </div><div><br></div><div>Rather than asking contributors to install lit via the Python Package Index, I was considering using the apple/llvm repository's copy. Contributors would need to have cloned llvm in a specific directory relative to the cloned swift-corelibs-xctest, like so:</div><div><br></div><div>rootdir/</div><div> llvm/</div><div> swift-corelibs-xctest/</div><div><br></div><div>This appears to be a convention in the Swift family of repositories, so I don't anticipate this to cause confusion among contributors.</div><div><br></div><div>If anyone has any input on this approach to lit, or on the direction of these changes in general, please let me know! All feedback is greatly appreciated.</div><div><br></div><div>- Brian Gesiak</div></div>
<div class="gmail_quote">_____________________________<br>From: Mike Ferris <<a dir="ltr" href="mailto:mferris@apple.com" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="3">mferris@apple.com</a>><br>Sent: Friday, December 4, 2015 3:42 PM<br>Subject: Re: [swift-corelibs-dev] [xctest] Who tests the tests?<br>To: Brian Gesiak <<a dir="ltr" href="mailto:modocache@gmail.com" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="6">modocache@gmail.com</a>><br>Cc: Tony Parker <<a dir="ltr" href="mailto:anthony.parker@apple.com" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="8">anthony.parker@apple.com</a>>, <<a dir="ltr" href="mailto:swift-corelibs-dev@swift.org" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="9">swift-corelibs-dev@swift.org</a>>, Daniel Dunbar <<a dir="ltr" href="mailto:daniel_dunbar@apple.com" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="10">daniel_dunbar@apple.com</a>><br><br><br> <meta content="text/html charset=utf-8"> Oops. It was pointed out to me that XCTestObserver is deprecated. I get it confused sometimes with its replacement.. What we’d presumably want to pursue adding the the corelibs XCTest is the API from XCTestObservation.h (and associated stuff). <div class=""> <br class=""> </div> <div class=""> Your same questions about the bundle stuff will still apply, though. On the other hand, perhaps a partial implementation that at least allowed observation starting at the test suites or even just at the test cases would suffice to start things off. </div> <div class=""> <br class=""> </div> <div class=""> <br class=""> </div> <div class=""> Mike </div> <div class=""> <br class=""> <div> <blockquote class=""> <div class=""> On Dec 4, 2015, at 9:08 AM, Brian Gesiak < <a href="mailto:modocache@gmail.com" class="">modocache@gmail.com</a>> wrote: </div> <br class="Apple-interchange-newline"> <div class=""> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Excellent, thanks for the feedback everyone!</span> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On Thu, Dec 3, 2015 at 10:39 PM, Daniel Dunbar <</span> <a href="mailto:daniel_dunbar@apple.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">daniel_dunbar@apple.com</a> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">> wrote:</span> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> It should be possible to use an out-of-process model that still uses XCTest itself to run the tests. For example, in the package manager we have some tests which spawn the package manager in order to test the end-to-end behavior. Ideally we would only do this for a small number of tests that really need this level of testing, and use unit testing for the rest. <br class=""> </blockquote> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">I'll send a pull request with this approach, since I believe it's the</span> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">least invasive to the current API while still getting us regression</span> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">tests for the current implementation. Of course I'd be thrilled if</span> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">someone beats me to it! :)</span> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> On Dec 3, 2015, at 8:03 PM, Tony Parker < <a href="mailto:anthony.parker@apple.com" class="">anthony.parker@apple.com</a>> wrote: <br class="">The reason I’m asking is that (like Foundation and dispatch), we’re trying to keep the API surface of this XCTest very similar to the one that ships today with Xcode. This will help developers who need to integrate their cross-platform tests into suites that include features that Obj-C XCTest has that we will probably not add to the Swift one (e.g., UI testing). <br class=""> </blockquote> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Absolutely agree. Still, once we have regression tests in place, I'd</span> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">love to start a conversation about whether we could provide a Obj-C</span> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">XCTest-compatible API layer on top of some more flexible architecture.</span> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> On Fri, Dec 4, 2015 at 11:24 AM, Mike Ferris < <a href="mailto:mferris@apple.com" class="">mferris@apple.com</a>> wrote: <br class="">One possible direction to consider which would be more consistent with our goals this year for API-compatibility would be to look into implementing XCTestObserver. <br class=""> </blockquote> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Yes! Very exciting. We'll need to consider how methods like</span> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">`-[XCTestObservation testBundleWillStart:]` map to SwiftXCTest,</span> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">especially considering we don't use NSBundle at all (which I think is</span> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">a great thing). I'll be looking forward to participating in more</span> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">discussions on this mailing list.</span> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">- Brian Gesiak</span> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On Fri, Dec 4, 2015 at 11:24 AM, Mike Ferris <</span> <a href="mailto:mferris@apple.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">mferris@apple.com</a> <span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">> wrote:</span> <br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> <br class="">One possible direction to consider which would be more consistent with our goals this year for API-compatibility would be to look into implementing XCTestObserver. <br class=""> <br class="">Mike <br class=""> <br class="">On Dec 3, 2015, at 8:03 PM, Tony Parker < <a href="mailto:anthony.parker@apple.com" class="">anthony.parker@apple.com</a>> wrote: <br class=""> <br class="">Hi Brian, <br class=""> <br class="">On Dec 3, 2015, at 3:45 PM, Brian Gesiak < <a href="mailto:modocache@gmail.com" class="">modocache@gmail.com</a>> wrote: <br class=""> <br class="">Hello! This is in reference to <a href="https://github.com/apple/swift-corelibs-xctest/pull/3" class="">https://github.com/apple/swift-corelibs-xctest/pull/3</a>. That pull request contains a commit that attempts to refactor XCTest such that it is more "unit-testable”. <br class=""> <br class=""> <br class="">Cool, thanks for looking into this area. <br class=""> <br class="">To do so, it gives XCTMain an additional parameter: a list of objects conforming to the Reporter protocol. I think of this as a minimal, corelibs equivalent to Apple's XCTest's XCTestObserver.h. I say "minimal" because Reporter only defines Reporter.log(), whereas XCTestObserver has one method for each kind of test event (started, failed, finished, etc.). <br class=""> <br class=""> <br class="">Do you think it’d be possible to split out the idea of adding this new API to XCTest from getting some tests for XCTest itself? <br class=""> <br class="">The reason I’m asking is that (like Foundation and dispatch), we’re trying to keep the API surface of this XCTest very similar to the one that ships today with Xcode. This will help developers who need to integrate their cross-platform tests into suites that include features that Obj-C XCTest has that we will probably not add to the Swift one (e.g., UI testing). <br class=""> <br class="">We made a concession to language limitations with the XCTMain function, because there is no way to dynamically discover all of the test cases. I’d really like to get rid of it in the long term in favor of something else; maybe a decoration like @testable that we could find automatically. <br class=""> <br class="">- Tony <br class=""> <br class="">These reporters are, for now, storied in a global array. In the future, I'd like to discuss moving XCTest to a model in which all tests are (optionally) run in sub-processes, each of which may (optionally) run in parallel. This global array most certainly won't work for such a change, but for now, I simply want to have regression tests on the project. It's hard to send pull requests without knowing everything still works! <br class=""> <br class="">Besides this approach, which modifies XCTest in order to test it, it may be more prudent to add tests *without* changing XCTest at all. To do so, I could add tests that run programs that call XCTMain(), then verify what's printed to stdout. This could be done using a Python script (which would go well with the build script, also in Python). <br class=""> <br class="">I'd love input on which of these approaches sounds more viable. Other ideas are also, of course, welcome! <br class=""> <br class="">- Brian Gesiak <br class=""> <br class=""> <br class=""> <br class="">_______________________________________________ <br class="">swift-corelibs-dev mailing list <br class=""> <a href="mailto:swift-corelibs-dev@swift.org" class="">swift-corelibs-dev@swift.org</a> <br class=""> <a href="https://lists.swift.org/mailman/listinfo/swift-corelibs-dev" class="">https://lists.swift.org/mailman/listinfo/swift-corelibs-dev</a> </blockquote> </div> </blockquote> </div> <br class=""> </div> <br><br></div>