MCPcopy Create free account
hub / github.com/EmbeddedRPC/erpc / ExitSummary

Function ExitSummary

test/common/gtest/gtest.cpp:7110–7132  ·  view source on GitHub ↗

Generates a textual description of a given exit code, in the format specified by wait(2).

Source from the content-addressed store, hash-verified

7108// Generates a textual description of a given exit code, in the format
7109// specified by wait(2).
7110static std::string ExitSummary(int exit_code) {
7111 Message m;
7112
7113# if GTEST_OS_WINDOWS
7114
7115 m << "Exited with exit status " << exit_code;
7116
7117# else
7118
7119 if (WIFEXITED(exit_code)) {
7120 m << "Exited with exit status " << WEXITSTATUS(exit_code);
7121 } else if (WIFSIGNALED(exit_code)) {
7122 m << "Terminated by signal " << WTERMSIG(exit_code);
7123 }
7124# ifdef WCOREDUMP
7125 if (WCOREDUMP(exit_code)) {
7126 m << " (core dumped)";
7127 }
7128# endif
7129# endif // GTEST_OS_WINDOWS
7130
7131 return m.GetString();
7132}
7133
7134// Returns true if exit_status describes a process that was terminated
7135// by a signal, or exited normally with a nonzero exit code.

Callers 1

PassedMethod · 0.85

Calls 1

GetStringMethod · 0.80

Tested by

no test coverage detected