|
@@ -36,21 +36,10 @@ class GRPCTestCase: XCTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
override func tearDown() {
|
|
override func tearDown() {
|
|
|
- let logs = self.capturedLogs()
|
|
|
|
|
-
|
|
|
|
|
- // The default source emitted by swift-log is the directory containing the '#filePath' in which the
|
|
|
|
|
- // log was emitted. It's meant to represent the system which emitted the log, typically the
|
|
|
|
|
- // module name. In most cases it's right but in a few places, i.e. where the source lives in
|
|
|
|
|
- // child directories below 'GRPC', it isn't. We'll use this as a sanity check.
|
|
|
|
|
- //
|
|
|
|
|
- // See also: https://github.com/apple/swift-log/issues/145
|
|
|
|
|
- for log in logs {
|
|
|
|
|
- XCTAssertEqual(log.source, "GRPC", "Incorrect log source in \(log.file) on line \(log.line)")
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
// Only print logs when there's a failure and we're *not* always logging (when we are always
|
|
// Only print logs when there's a failure and we're *not* always logging (when we are always
|
|
|
// logging, logs will be printed as they're caught).
|
|
// logging, logs will be printed as they're caught).
|
|
|
if !GRPCTestCase.alwaysLog, (self.testRun.map { $0.totalFailureCount > 0 } ?? false) {
|
|
if !GRPCTestCase.alwaysLog, (self.testRun.map { $0.totalFailureCount > 0 } ?? false) {
|
|
|
|
|
+ let logs = self.capturedLogs()
|
|
|
self.printCapturedLogs(logs)
|
|
self.printCapturedLogs(logs)
|
|
|
}
|
|
}
|
|
|
|
|
|