diff options
author | alexv-smirnov <alex@ydb.tech> | 2023-03-22 12:12:11 +0300 |
---|---|---|
committer | alexv-smirnov <alex@ydb.tech> | 2023-03-22 12:12:11 +0300 |
commit | 04eca104ab81b8b331598b2cfec5e193f32fb6ec (patch) | |
tree | e1c54f0ca30d022d54a525401c51422617cd0ac2 /library | |
parent | 15168eacfd3bc1a3ddeea8b110d15f39d8314ce0 (diff) | |
download | ydb-04eca104ab81b8b331598b2cfec5e193f32fb6ec.tar.gz |
unittest junitxml add suite name to classname
Diffstat (limited to 'library')
-rw-r--r-- | library/cpp/testing/unittest/junit.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/library/cpp/testing/unittest/junit.cpp b/library/cpp/testing/unittest/junit.cpp index ff1d50fb21..27e31199e4 100644 --- a/library/cpp/testing/unittest/junit.cpp +++ b/library/cpp/testing/unittest/junit.cpp @@ -220,6 +220,8 @@ void TJUnitProcessor::SerializeToFile() { xmlFreeTextWriter(file); }; + CHECK_CALL(xmlTextWriterSetIndent(file, 1)); + CHECK_CALL(xmlTextWriterStartDocument(file, nullptr, "UTF-8", nullptr)); CHECK_CALL(xmlTextWriterStartElement(file, XML_STR("testsuites"))); CHECK_CALL(xmlTextWriterWriteAttribute(file, XML_STR("tests"), XML_STR(ToString(GetTestsCount()).c_str()))); @@ -235,6 +237,7 @@ void TJUnitProcessor::SerializeToFile() { for (const auto& [testName, test] : suite.Cases) { CHECK_CALL(xmlTextWriterStartElement(file, XML_STR("testcase"))); + CHECK_CALL(xmlTextWriterWriteAttribute(file, XML_STR("classname"), XML_STR(suiteName.c_str()))); CHECK_CALL(xmlTextWriterWriteAttribute(file, XML_STR("name"), XML_STR(testName.c_str()))); CHECK_CALL(xmlTextWriterWriteAttribute(file, XML_STR("id"), XML_STR(testName.c_str()))); CHECK_CALL(xmlTextWriterWriteAttribute(file, XML_STR("time"), XML_STR(ToString(test.DurationSecods).c_str()))); |