[swift-users] XCTest from repl

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


Greetings,

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
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks

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
errordlopen("/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Versions/A/XCTest",
RTLD_NOW)dlopen("/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftXCTest.dylib",
RTLD_NOW)import XCTest
class MyTest : XCTestCase {
    override func setUp() {
        super.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?

Thanks,
Lou
-------------- 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