[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
<https://github.com/apple/swift/commit/ad269b0e1fbc12037ae2c16634b5b451061657c6>
it looks as if IsTestCandidate has been moved out of SourceKit and into
libIndex:
- isTestCandidate(swift::ValueDecl)
<https://github.com/apple/swift/blob/8dad7f780347788f6032ad9e25ce5340aecf4073/lib/Index/Index.cpp#L754>
- swift::index::FuncDeclIndexSymbol.IsTestCandidate
<https://github.com/apple/swift/blob/41e4e9b6efc745f04df23bd6a803a467c57a66b8/include/swift/Index/IndexSymbol.h#L102>
and where it’s set
<https://github.com/apple/swift/blob/8dad7f780347788f6032ad9e25ce5340aecf4073/lib/Index/Index.cpp#L786>
.
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>
wrote:
>
> 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