[swift-users] XCTest from repl

Lou Zell lzell11 at gmail.com
Mon Aug 8 14:25:49 CDT 2016


I am close to getting XCTests running in the swift repl, but for some
reason my tests are never invoked.  Does anyone have a suggestion or see
something wrong with the test setup?

$ xcrun swift -F

import Foundation // If you're copy pasting, copy paste these
individually!// If you get a null pointer back, use perror(dlerror())
to get a description of the
RTLD_NOW)import XCTest
class MyTest : XCTestCase {
    override func setUp() {
        print("Setting up")
    }    override func tearDown() {
        super.tearDown()                      print("Tearing down")
    func testIt() {
        print("I'm never here")
        XCTAssertTrue(false, "I never see this!")
    } }

let suite = XCTestSuite(name: "foo")suite.addTest(MyTest())suite.run()

I see the "setting up" and "tearing down" output, but I never see the print
inside -testIt.  Any ideas?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160808/44377060/attachment.html>

More information about the swift-users mailing list