I want to test drive some Swift examples using XCTest from the command line if possible.
import XCTest
class LeapTest : XCTestCase {
func testVanillaLeapYear() {
let year = Year(calendarYear: 1996)
XCTAssertTrue(year.isLeapYear);
}
}
I'd love to run it from the command line.
I already set Xcode to use the developer tools in the beta:
sudo xcode-select -s /Applications/Xcode6-Beta.app/Contents/Developer/
If I naively try and run it it goes like this
$ xcrun swift LeapTest.swift
LeapTest.swift:1:8: error: cannot load underlying module for 'XCTest'
import XCTest
^
Any way to run it directly from the CLI? Or do I have to create a Xcode project?