google / google/googletest

::testing::Test::RecordProperty adding child elements instead of testcase attributes in the output XML

Open
#2,989 0 comments 2 reactions 1 assignee Claimed by @derekmauro View on GitHub
Dominant language
C++
Stars
39.5k
Forks
10.9k
Avg merge
6d 13h
Merged PRs (30d)
1

Description

As an example, I've modified one of the tests in `sample1_unittest` the following way:
```c++
TEST(FactorialTest, Negative) {
EXPECT_EQ(1, Factorial(-5));
EXPECT_EQ(1, Factorial(-1));
EXPECT_GT(Factorial(-10), 0);
::testing::Test::RecordProperty("Hello", "World");
}
```
Running the test with `sample1_unittest.exe --gtest_output=xml` results in the following XML output:
```xml










```

I was expecting based on [Logging Additional Information](https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#logging-additional-information) the Negative testcase to have a `Hello` atttribute with `World` value like this:
```xml

```

Is this a bug or the way it's supposed to work?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.