debuggerd_test: improve error when crasher fails to exec. am: 7a0ee64f9d am: 1255609232

am: 5c52c64d65

Change-Id: I2e453d05749a32d56dd0b31541ba35e5d3f5ceb5
This commit is contained in:
Josh Gao 2017-02-08 20:24:23 +00:00 committed by android-build-merger
commit 6cf71fcb6e

View file

@ -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));