MCPcopy Create free account
hub / github.com/Compaile/ctrack / test_case_start_impl

Method test_case_start_impl

test/doctest.h:5468–5498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5466 unsigned line(unsigned l) const { return opt.no_line_numbers ? 0 : l; }
5467
5468 void test_case_start_impl(const TestCaseData& in) {
5469 bool open_ts_tag = false;
5470 if(tc != nullptr) { // we have already opened a test suite
5471 if(std::strcmp(tc->m_test_suite, in.m_test_suite) != 0) {
5472 xml.endElement();
5473 open_ts_tag = true;
5474 }
5475 }
5476 else {
5477 open_ts_tag = true; // first test case ==> first test suite
5478 }
5479
5480 if(open_ts_tag) {
5481 xml.startElement("TestSuite");
5482 xml.writeAttribute("name", in.m_test_suite);
5483 }
5484
5485 tc = ∈
5486 xml.startElement("TestCase")
5487 .writeAttribute("name", in.m_name)
5488 .writeAttribute("filename", skipPathFromFilename(in.m_file.c_str()))
5489 .writeAttribute("line", line(in.m_line))
5490 .writeAttribute("description", in.m_description);
5491
5492 if(Approx(in.m_timeout) != 0)
5493 xml.writeAttribute("timeout", in.m_timeout);
5494 if(in.m_may_fail)
5495 xml.writeAttribute("may_fail", true);
5496 if(in.m_should_fail)
5497 xml.writeAttribute("should_fail", true);
5498 }
5499
5500 // =========================================================================================
5501 // WHAT FOLLOWS ARE OVERRIDES OF THE VIRTUAL METHODS OF THE REPORTER INTERFACE

Callers

nothing calls this directly

Calls 2

skipPathFromFilenameFunction · 0.85
ApproxFunction · 0.85

Tested by

no test coverage detected