MCPcopy Create free account
hub / github.com/Icinga/icinga2 / CTestFileGeneratorFixture

Method CTestFileGeneratorFixture

test/test-ctest.cpp:99–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99CTestFileGeneratorFixture::CTestFileGeneratorFixture()
100{
101 auto& mts = boost::unit_test::framework::master_test_suite();
102 int argc = mts.argc;
103 for (int i = 1; i < argc; i++) {
104 std::string argument(mts.argv[i]);
105
106 if (argument == "--generate_ctest_config") {
107 if (argc >= i + 1) {
108 boost::filesystem::path testbin(mts.argv[0]);
109 boost::filesystem::path file(mts.argv[i + 1]);
110
111 try {
112 CTestFileGenerator visitor{testbin, file};
113 traverse_test_tree(mts, visitor);
114 } catch (const std::exception& ex) {
115 std::cerr << "Error: --generate_ctest_config failed with: " << ex.what() << '\n';
116 std::_Exit(EXIT_FAILURE);
117 }
118 } else {
119 std::cerr << "Error: --generate_ctest_config specified with no argument.\n";
120 std::_Exit(EXIT_FAILURE);
121 }
122
123 std::_Exit(EXIT_SUCCESS);
124 }
125 }
126}

Callers

nothing calls this directly

Calls 1

whatMethod · 0.45

Tested by

no test coverage detected