diff options
| author | n-khamraev <[email protected]> | 2026-03-03 10:23:41 +0300 |
|---|---|---|
| committer | n-khamraev <[email protected]> | 2026-03-03 10:42:22 +0300 |
| commit | 3e610a450fe3ab97500c04bfdb9ca86e892e37b0 (patch) | |
| tree | 3828c485967457078d5e1cdee2a19ab32fc3effc /library/cpp/testing/gtest/main.cpp | |
| parent | e03d1bdddd44a80bddb7aaeaa173a1efabdd55fe (diff) | |
Activate json tests list logic and add tests
```
Listing of tests information into json file (--list-verbose) now uses json with extended meta data instead of :: separated string
* Changelog entry
Type: feature
Component: cpp-sdk
--list-verbose commands in Gtest and unittest are now using json with extended meta data instead of plain "::"-separated string
```
commit_hash:096b575c80989be0166f54b214e595dc58977fe0
Diffstat (limited to 'library/cpp/testing/gtest/main.cpp')
| -rw-r--r-- | library/cpp/testing/gtest/main.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/library/cpp/testing/gtest/main.cpp b/library/cpp/testing/gtest/main.cpp index 05cca1b71a7..ab2ee4a688c 100644 --- a/library/cpp/testing/gtest/main.cpp +++ b/library/cpp/testing/gtest/main.cpp @@ -408,23 +408,18 @@ void NGTest::ListTests(int listLevel, const std::string& listPath) { if (listLevel > 1) { for (int j = 0; j < suite->total_test_count(); ++j) { auto test = suite->GetTestInfo(j); - if (false) { - // TODO: YA-3943 будет открыто в следующем PR, активироввать функционал нужно в два шага - NJson::TJsonValue testObj(NJson::JSON_MAP); + NJson::TJsonValue testObj(NJson::JSON_MAP); - testObj["test_suite_name"] = test->test_suite_name(); - testObj["name"] = test->name(); - testObj["file"] = test->file() ? test->file() : ""; - testObj["line"] = test->line(); - testObj["nodeid"] = std::string(test->test_suite_name()) + "::" + test->name(); - if (test->value_param()) { - testObj["params"] = test->value_param(); - } - - (*listOut) << NJson::WriteJson(&testObj) << "\n"; - } else { - (*listOut) << suite->name() << "::" << test->name() << "\n"; + testObj["test_suite_name"] = test->test_suite_name(); + testObj["name"] = test->name(); + testObj["file"] = test->file() ? test->file() : ""; + testObj["line"] = test->line(); + testObj["nodeid"] = std::string(test->test_suite_name()) + "::" + test->name(); + if (test->value_param()) { + testObj["params"] = test->value_param(); } + + (*listOut) << NJson::WriteJson(&testObj, false) << "\n"; } } else { (*listOut) << suite->name() << "\n"; |
