| 2375 | unsigned line(unsigned l) const { return opt.no_line_numbers ? 0 : l; } |
| 2376 | |
| 2377 | void test_case_start_impl(const TestCaseData& in) { |
| 2378 | bool open_ts_tag = false; |
| 2379 | if(tc != nullptr) { // we have already opened a test suite |
| 2380 | if(std::strcmp(tc->m_test_suite, in.m_test_suite) != 0) { |
| 2381 | xml.endElement(); |
| 2382 | open_ts_tag = true; |
| 2383 | } |
| 2384 | } |
| 2385 | else { |
| 2386 | open_ts_tag = true; // first test case ==> first test suite |
| 2387 | } |
| 2388 | |
| 2389 | if(open_ts_tag) { |
| 2390 | xml.startElement("TestSuite"); |
| 2391 | xml.writeAttribute("name", in.m_test_suite); |
| 2392 | } |
| 2393 | |
| 2394 | tc = ∈ |
| 2395 | xml.startElement("TestCase") |
| 2396 | .writeAttribute("name", in.m_name) |
| 2397 | .writeAttribute("filename", skipPathFromFilename(in.m_file.c_str())) |
| 2398 | .writeAttribute("line", line(in.m_line)) |
| 2399 | .writeAttribute("description", in.m_description); |
| 2400 | |
| 2401 | if(Approx(in.m_timeout) != 0) |
| 2402 | xml.writeAttribute("timeout", in.m_timeout); |
| 2403 | if(in.m_may_fail) |
| 2404 | xml.writeAttribute("may_fail", true); |
| 2405 | if(in.m_should_fail) |
| 2406 | xml.writeAttribute("should_fail", true); |
| 2407 | } |
| 2408 | |
| 2409 | // ========================================================================================= |
| 2410 | // WHAT FOLLOWS ARE OVERRIDES OF THE VIRTUAL METHODS OF THE REPORTER INTERFACE |
nothing calls this directly
no test coverage detected