0001 #if os(Linux) 0002 import Glibc 0003 #else 0004 import Darwin.C 0005 #endif 0006 0007 0008 let globalContext: GlobalContext = { 0009 atexit { run() } 0010 return GlobalContext() 0011 }() 0012 0013 public func describe(name:String, closure:ContextType -> ()) { 0014 globalContext.describe(name, closure: closure) 0015 } 0016 0017 public func it(name:String, closure:() throws -> ()) { 0018 globalContext.it(name, closure: closure) 0019 } 0020 0021 @noreturn public func run
Global.swift:14 globalContext.describe(name, closure: closure)Global.swift:18 globalContext.it(name, closure: closure)Global.swift:36 if globalContext.run(reporter) {() { 0022 let reporter: Reporter 0023 0024 if Process.arguments.contains("--tap") { 0025 reporter = TapReporter() 0026 } else if Process.arguments.contains("-t") { 0027 reporter = DotReporter() 0028 } else { 0029 reporter = StandardReporter() 0030 } 0031 0032 run(reporter) 0033 } 0034 0035 @noreturn public func run
Global.swift:9 atexit { run() }(reporter: Reporter) { 0036 if globalContext.run(reporter) { 0037 exit(0) 0038 } 0039 exit(1) 0040 } 0041
Global.swift:32 run(reporter)