MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / test_case_start_impl

Method test_case_start_impl

tests/framework/src/doctest.cpp:2353–2383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2351 unsigned line(unsigned l) const { return opt.no_line_numbers ? 0 : l; }
2352
2353 void test_case_start_impl(const TestCaseData& in) {
2354 bool open_ts_tag = false;
2355 if(tc != nullptr) { // we have already opened a test suite
2356 if(std::strcmp(tc->m_test_suite, in.m_test_suite) != 0) {
2357 xml.endElement();
2358 open_ts_tag = true;
2359 }
2360 }
2361 else {
2362 open_ts_tag = true; // first test case ==> first test suite
2363 }
2364
2365 if(open_ts_tag) {
2366 xml.startElement("TestSuite");
2367 xml.writeAttribute("name", in.m_test_suite);
2368 }
2369
2370 tc = ∈
2371 xml.startElement("TestCase")
2372 .writeAttribute("name", in.m_name)
2373 .writeAttribute("filename", skipPathFromFilename(in.m_file.c_str()))
2374 .writeAttribute("line", line(in.m_line))
2375 .writeAttribute("description", in.m_description);
2376
2377 if(Approx(in.m_timeout) != 0)
2378 xml.writeAttribute("timeout", in.m_timeout);
2379 if(in.m_may_fail)
2380 xml.writeAttribute("may_fail", true);
2381 if(in.m_should_fail)
2382 xml.writeAttribute("should_fail", true);
2383 }
2384
2385 // =========================================================================================
2386 // WHAT FOLLOWS ARE OVERRIDES OF THE VIRTUAL METHODS OF THE REPORTER INTERFACE

Callers

nothing calls this directly

Calls 4

skipPathFromFilenameFunction · 0.85
ApproxFunction · 0.85
lineClass · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected