diff options
author | lliabraa@chromium.org <lliabraa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-02 13:41:33 +0000 |
---|---|---|
committer | lliabraa@chromium.org <lliabraa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-02 13:41:33 +0000 |
commit | e3e57fe9c9fd3b322ba3e9ac60d4a8a8038c6562 (patch) | |
tree | 13a5835ba3f95217c62b4845197f5f372c4e4184 /testing/iossim | |
parent | cc7a544c7ed441865a8cabe21409314c857d1831 (diff) | |
download | chromium_src-e3e57fe9c9fd3b322ba3e9ac60d4a8a8038c6562.zip chromium_src-e3e57fe9c9fd3b322ba3e9ac60d4a8a8038c6562.tar.gz chromium_src-e3e57fe9c9fd3b322ba3e9ac60d4a8a8038c6562.tar.bz2 |
In iossim, ignore harmless messages from launchd.
iossim checks the system log for messages from launchd about the simulated app and returns failure if anything is found. Some messages are harmless, so this CL updates iossim to log them but not return failure.
BUG=None
Review URL: https://chromiumcodereview.appspot.com/11699005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174802 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'testing/iossim')
-rw-r--r-- | testing/iossim/iossim.mm | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/testing/iossim/iossim.mm b/testing/iossim/iossim.mm index 47778ca..7d5dbf8 100644 --- a/testing/iossim/iossim.mm +++ b/testing/iossim/iossim.mm @@ -291,19 +291,23 @@ void LogWarning(NSString* format, ...) { ASL_QUERY_OP_EQUAL); asl_set_query(query, ASL_KEY_TIME, "-1m", ASL_QUERY_OP_GREATER_EQUAL); - // Log any messages found. + // Log any messages found, and take note of any messages that may indicate the + // app crashed or did not exit cleanly. aslresponse response = asl_search(NULL, query); - BOOL entryFound = NO; + BOOL badEntryFound = NO; aslmsg entry; while ((entry = aslresponse_next(response)) != NULL) { - entryFound = YES; - LogWarning(@"Console message: %s", asl_get(entry, ASL_KEY_MSG)); + const char* message = asl_get(entry, ASL_KEY_MSG); + LogWarning(@"Console message: %s", message); + // Some messages are harmless, so don't trigger a failure for them. + if (strstr(message, "The following job tried to hijack the service")) + continue; + badEntryFound = YES; } - // launchd only sends messages if the process crashed or exits with a - // non-zero status, so if the query returned any results iossim should exit - // with non-zero status. - if (entryFound) { + // If the query returned any nasty-looking results, iossim should exit with + // non-zero status. + if (badEntryFound) { LogError(@"Simulated app crashed or exited with non-zero status"); exit(kExitAppCrashed); } |