[swift-dev] [SR-710][RFC] Automatically detecting XCTest test methods on Linux: Reflection? SourceKit?

Brian Gesiak modocache at gmail.com
Sun Apr 24 22:59:55 CDT 2016

Thanks to this commit
it looks as if IsTestCandidate has been moved out of SourceKit and into

   - isTestCandidate(swift::ValueDecl)
   - swift::index::FuncDeclIndexSymbol.IsTestCandidate
   and where it’s set

I’m looking into adding an option to swiftc to emit XCTest candidate
methods. How does swiftc -frontend -dump-xctest-methods sound?

- Brian Gesiak

On Sun, Apr 17, 2016 at 5:50 PM, Drew Crawford <drew at sealedabstract.com>

> On Apr 3, 2016, at 10:05 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> Hmm... but then wouldn't that more tightly couple the test discovery tool
> and the Swift compiler? In an earlier email you said you "like #3 better
> [...] because that would decouple the test discovery tool from the Swift
> compiler." I think that part is confusing me.
> Sorry -- what I meant is that the compiler remains the point of truth
> about the language and can find the tests.  The tools that actually
> generate glue code won't need to parse code, and would be decoupled
> from the compiler.
> I am internally shipping a test framework that discovers tests via an
> out-of-tree parser.  Teaching swiftc about XCTest syntax is not sufficient
> to deprecate my parser, and therefore is not sufficient for the compiler to
> be the source of truth for my tests.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20160424/e2b2f941/attachment.html>

More information about the swift-dev mailing list