Skip to content

Instantly share code, notes, and snippets.

@drosenstark
Created March 17, 2019 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drosenstark/0f8e0a2340247b4dcc3360e1018ee4f1 to your computer and use it in GitHub Desktop.
Save drosenstark/0f8e0a2340247b4dcc3360e1018ee4f1 to your computer and use it in GitHub Desktop.
Run XCTest stuff using the Swift command line on macOS
/// Run with:
/// swift -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks xctest-in-repl.swift
import Foundation
import XCTest
class ATest : XCTestCase {
func testIt() {
print("Oh yeah, it's on")
XCTAssertTrue(false, "That needed to be true!")
}
func testThat() {
XCTAssertNil(nil, "Hell yes!")
}
}
XCTestSuite(forTestCaseClass: ATest.self).run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment