diff options
author | Josh Gao <jmgao@google.com> | 2017-02-07 13:31:25 -0800 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2017-02-07 13:36:08 -0800 |
commit | 7a0ee64f9df226012d19cd50ed93117d03cbb01d (patch) | |
tree | 9a79692bc2a7adb658d550b40a98684f4828bcc0 /debuggerd/debuggerd_test.cpp | |
parent | a7d7eb6d2ae98e1147af678cf7e78ce4ff83e529 (diff) |
debuggerd_test: improve error when crasher fails to exec.
Bug: http://b/35100742
Test: rm /system/bin/crasher && /data/nativetest/debugerd_test/debuggerd_test32
Change-Id: I02faec3b7f7ef62bb8a2ac2af730506e3d28e03e
Diffstat (limited to 'debuggerd/debuggerd_test.cpp')
-rw-r--r-- | debuggerd/debuggerd_test.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/debuggerd/debuggerd_test.cpp b/debuggerd/debuggerd_test.cpp index 8e38d0dc2..002e940d9 100644 --- a/debuggerd/debuggerd_test.cpp +++ b/debuggerd/debuggerd_test.cpp @@ -192,7 +192,7 @@ void CrasherTest::StartCrasher(const std::string& crash_type) { std::string type = "wait-" + crash_type; StartProcess([type]() { execl(CRASHER_PATH, CRASHER_PATH, type.c_str(), nullptr); - err(1, "exec failed"); + exit(errno); }); } @@ -216,7 +216,9 @@ void CrasherTest::AssertDeath(int signo) { FAIL() << "failed to wait for crasher: " << strerror(errno); } - if (!WIFSIGNALED(status)) { + if (WIFEXITED(status)) { + FAIL() << "crasher failed to exec: " << strerror(WEXITSTATUS(status)); + } else if (!WIFSIGNALED(status)) { FAIL() << "crasher didn't terminate via a signal"; } ASSERT_EQ(signo, WTERMSIG(status)); |