You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Xcode 8 killed XcodeColors, the current way using XCTestLog on Xcode 8 is just plain texts with emoji. You could still use XCTestLog to stylish XCTest logs without coloring.
XLTestLog v1.1+ will remove "color code" from logs if you don't privide a UseXcodeColors == YES preprocess macro.
Introduction
XLTestLog is a lightweight library for stylish XCTest logs. It makes your testing logs more readable in Xcode Console.
Reformat the log messages to make them more readable.
Use indentations and Emoji bullets for different logs.
Paint log messages and highlight important keywords using XcodeColors.
Only test logs will be styled. You can distinguish colored test logs from other logs (e.g. NSLog()).
The following is an example for test results in Xcode Console using XLTestLog:
And this is without using XLTestLog:
The readability between them is quite different. The original test code for the console logs is simple (one passed test, one failed test, one measure task, and one message fromNSLog()):
@implementationXLTestLogDevTests
- (void)testPassedCase {
XCTAssert(YES, @"Pass");
NSLog(@"This is a message from `NSLog()`.");
}
- (void)testFailureCase {
XCTAssert(NO, @"Fail");
}
- (void)testPerformanceExample {
// This is an example of a performance test case.
[selfmeasureBlock:^{
int j = 0;
for (int i = 0; i < 1000000; i++) {
j += i;
}
}];
}
@end