Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Unified Diff: testing/iossim/iossim.mm

Issue 2167773003: Ignore stderr failure messages on iossim when not running xctests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/iossim/iossim.mm
diff --git a/testing/iossim/iossim.mm b/testing/iossim/iossim.mm
index 3c1e353eeae30918d9da25c6deb7af088068e7f9..a1b174c4fa8bfc4c759d6122413fa8de4e2d74e0 100644
--- a/testing/iossim/iossim.mm
+++ b/testing/iossim/iossim.mm
@@ -258,6 +258,24 @@ void RunApplication(NSString* app_path,
[@"platform=iOS Simulator,id=" stringByAppendingString:udid],
@"test-without-building"
]] autorelease];
+
+ // The following stderr messages are meaningless on iossim when not running
+ // xctests and can be safely stripped.
+ if (!xctest_path) {
+ NSPipe* stderr_pipe = [NSPipe pipe];
+ stderr_pipe.fileHandleForReading.readabilityHandler =
+ ^(NSFileHandle* handle) {
+ NSString* log = [[[NSString alloc] initWithData:handle.availableData
+ encoding:NSUTF8StringEncoding]
+ autorelease];
+ if ([log containsString:@"IDETestOperationsObserverErrorDomain"] ||
+ [log containsString:@"** TEST EXECUTE FAILED **"]) {
+ return;
+ }
+ printf("%s", [log UTF8String]);
+ };
+ [task setStandardError:stderr_pipe];
+ }
[task run];
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698