<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I suggest adding <b class="">XCTestSuite.init</b> method with the following signature: <b class="">public init(name: String, testCaseEntries: [XCTestCaseEntry])</b> as for 1.<div class=""><blockquote type="cite" class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div class="" style="word-wrap: break-word;"><div class=""><ol class="m_7156828115953672639MailOutline"><li class="">I suggest implementing API that allows creating XCTestSuite from a list of XCTestCaseEntries. </li></ol></div></div></blockquote></div></div></div></blockquote></div></div></blockquote><div class="">Ilya</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 6 Dec 2016, at 12:50, Ilya Laryionau <<a href="mailto:larryonoff@gmail.com" class="">larryonoff@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Brian,</div><div class=""><br class=""></div><div class="">Thank you for your feedback.</div><div class=""><br class=""></div><div class="">I need some time to think about the API for the first and the seconds points. I’m going to create it as a list of protocol in gist.</div><div class=""><br class=""></div><div class="">Ilya</div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 5 Dec 2016, at 20:50, Brian Gesiak <<a href="mailto:modocache@gmail.com" class="">modocache@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Ilya,<div class=""><br class=""></div><div class="">I would love to see both of your suggestions implemented, but you may need to submit a swift-evolution proposal for them. I think Apple employees maintaining swift-corelibs-xctest would have a better idea of whether your proposals would be accepted by the core team. (+cc Brian Croom).</div><div class=""><br class=""></div><div class="">I think a good next step would be to reply to this email with the function signatures for the additions you're proposing. That will allow us to discuss them in more concrete terms.</div><div class=""><br class=""></div><div class="">Thanks for all the great suggestions!</div><div class=""><br class=""></div><div class="">- Brian Gesiak</div><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Dec 5, 2016 at 1:30 AM, Ilya Laryionau <span dir="ltr" class=""><<a href="mailto:larryonoff@gmail.com" target="_blank" class="">larryonoff@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">Brian,</div><div class=""><br class=""></div><div class="">I appreciate your comments.</div><span class=""><div class=""><br class=""><blockquote type="cite" class=""><div dir="ltr" class=""><div class=""><span style="font-size:12.800000190734863px" class="">You should check out </span><a href="https://bugs.swift.org/browse/SR-710" target="_blank" class="">https://bugs.swift.org/<wbr class="">browse/SR-710</a>. There's been a great deal of discussion on this topic in the past. I think we left off with the idea that we should use SourceKit to generate the list of tests (+cc Daniel Dunbar). This work has largely been abandoned. If you'd like to pick it up, you could have huge impact!</div></div></blockquote><br class=""></div></span><div class="">This’s a great comment. I’ll check what I can do.</div><span class=""><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div dir="ltr" class=""><div class="">I'm not sure I understand your first two points. Are you suggesting that we implement some method of kicking off tests on an iOS simulator, but only when corelibs-xctest framework is linked with the application bundle...? I'd appreciate it if you could explain what you mean in more detail.</div></div></blockquote><br class=""></div></span><div class="">Let me clarify my first two points.</div><div class=""><br class=""></div><div class=""><ol class="m_7156828115953672639MailOutline"><li class="">In general you’re correct. I suggest implementing some method that triggers the same logic that XCTestMain does. But instead of calling exit, when the work is done, returning the exit code.</li><li class="">I suggest implementing API that allows creating XCTestSuite from a list of XCTestCaseEntries. </li></ol></div><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">Ilya</div></font></span><div class=""><div class="h5"><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 2 Dec 2016, at 21:00, Brian Gesiak <<a href="mailto:modocache@gmail.com" target="_blank" class="">modocache@gmail.com</a>> wrote:</div><br class="m_7156828115953672639Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hey Ilya,<div class=""><br class=""></div><div class="">I'm glad you're thinking about how to use corelibs-xctest on mobile devices. I'd like to prepare it for Android as well, and I think there's a lot of overlap here.<br class=""><div class=""><br class=""></div><div class="">> <span style="font-size:12.800000190734863px" class="">This proposal is because Swift has very poor reflection at the moment. So I suggest creating a generator (pre-build script) for Swift test cases that for example is able analysing concrete folder with swift files and generate e.g. TestCases.swift file. This script is intended to be used manually.</span></div></div><div class=""><span style="font-size:12.800000190734863px" class=""><br class=""></span></div><div class=""><span style="font-size:12.800000190734863px" class="">You should check out </span><a href="https://bugs.swift.org/browse/SR-710" target="_blank" class="">https://bugs.swift.org/<wbr class="">browse/SR-710</a>. There's been a great deal of discussion on this topic in the past. I think we left off with the idea that we should use SourceKit to generate the list of tests (+cc Daniel Dunbar). This work has largely been abandoned. If you'd like to pick it up, you could have huge impact!</div><div class=""><br class=""></div><div class="">I'm not sure I understand your first two points. Are you suggesting that we implement some method of kicking off tests on an iOS simulator, but only when corelibs-xctest framework is linked with the application bundle...? I'd appreciate it if you could explain what you mean in more detail.</div><div class=""><br class=""></div><div class="">- Brian Gesiak</div><div class=""><span style="font-size:12.800000190734863px" class=""><br class=""></span></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Dec 2, 2016 at 5:57 AM, Ilya Laryionau via swift-corelibs-dev <span dir="ltr" class=""><<a href="mailto:swift-corelibs-dev@swift.org" target="_blank" class="">swift-corelibs-dev@swift.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Hello Community,<div class=""><br class=""></div><div class="">I’m working on adding iOS platform support for SwiftXCTest. So I’ve have the following proposals and would like to hear feedback from the community.</div><div class=""><ol class=""><li class="">SwiftXCTest runs the tests in a way `XCTMain([ testCase(TestFoo.allTests) ])`. XCTMain supports only Linux / FreeBSD / macOS. So I suggest introducing an API that will provide a similar way of running tests as XCTMain, but in a case using SwiftXCTest as a framework e.g. on iOS. It could be the same logic that just returns exit code, when XCTMain just exits with this code.</li><li class="">The suggestion above (number 1) is good, but too simple for using SwiftXCTest as a framework, since we only have exit code and debug logs. So my second proposal is providing mechanism of initialising root test suite with array of testCases (array of XCTestCaseEntry objects) with the same structure that XCTMain does. This isn’t possible now since XCTestCaseSuite class that is used to initialise root test suite (see XCTMain.swift line 80) is internal.</li><li class="">This proposal is because Swift has very poor reflection at the moment. So I suggest creating a generator (pre-build script) for Swift test cases that for example is able analysing concrete folder with swift files and generate e.g. TestCases.swift file. This script is intended to be used manually.</li></ol></div><div class="">Looking forward to any feedback.</div><span class="m_7156828115953672639HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">Ilya</div></font></span></div><br class="">______________________________<wbr class="">_________________<br class="">
swift-corelibs-dev mailing list<br class="">
<a href="mailto:swift-corelibs-dev@swift.org" target="_blank" class="">swift-corelibs-dev@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-corelibs-dev" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailma<wbr class="">n/listinfo/swift-corelibs-dev</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></div></body></html>