A concrete death test class that forks and re-executes the main program from the beginning, with command-line flags set that cause only this specific death test to be run.
| 8751 | // program from the beginning, with command-line flags set that cause |
| 8752 | // only this specific death test to be run. |
| 8753 | class ExecDeathTest : public ForkingDeathTest { |
| 8754 | public: |
| 8755 | ExecDeathTest(const char* a_statement, Matcher<const std::string&> matcher, |
| 8756 | const char* file, int line) |
| 8757 | : ForkingDeathTest(a_statement, std::move(matcher)), |
| 8758 | file_(file), |
| 8759 | line_(line) {} |
| 8760 | TestRole AssumeRole() override; |
| 8761 | |
| 8762 | private: |
| 8763 | static ::std::vector<std::string> GetArgvsForDeathTestChildProcess() { |
| 8764 | ::std::vector<std::string> args = GetInjectableArgvs(); |
| 8765 | # if defined(GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_) |
| 8766 | ::std::vector<std::string> extra_args = |
| 8767 | GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_(); |
| 8768 | args.insert(args.end(), extra_args.begin(), extra_args.end()); |
| 8769 | # endif // defined(GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_) |
| 8770 | return args; |
| 8771 | } |
| 8772 | // The name of the file in which the death test is located. |
| 8773 | const char* const file_; |
| 8774 | // The line number on which the death test is located. |
| 8775 | const int line_; |
| 8776 | }; |
| 8777 | |
| 8778 | // Utility class for accumulating command-line arguments. |
| 8779 | class Arguments { |
nothing calls this directly
no outgoing calls
no test coverage detected