Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xml Generation from Google test does not show skipped test cases count in tag testsuites #3836

Open
satishsingh0077 opened this issue May 13, 2022 · 2 comments
Assignees

Comments

@satishsingh0077
Copy link

satishsingh0077 commented May 13, 2022

I am using gtest version V1.11.0

I have disabled few tests and Skipped few tests. This is working fine and i can see the tests being disabled and skipped in the teminal log. The problem is when i am generating the xml file from the test.
--gtest_output=xml:/data/TestReport.xml
The generated XML
<?xml version="1.0" encoding="UTF-8"?> <testsuites tests="3" failures="0" disabled="1" errors="0" time="0" timestamp="2022-05-14T18:48:32.196" name="AllTests"> <testsuite name="Suite1" tests="2" failures="0" disabled="1" skipped="0" errors="0" time="0" timestamp="2022-05-14T18:48:32.196"> <testcase name="Test1" file="/home/satish/Documents/gtestNew/sqrt_test.cpp" line="6" status="run" result="completed" time="0" timestamp="2022-05-14T18:48:32.196" classname="Suite1" /> <testcase name="DISABLED_Test2" file="/home/satish/Documents/gtestNew/sqrt_test.cpp" line="11" status="notrun" result="suppressed" time="0" timestamp="1970-01-01T01:00:00.000" classname="Suite1" /> </testsuite> <testsuite name="Suite2" tests="1" failures="0" disabled="0" skipped="1" errors="0" time="0" timestamp="2022-05-14T18:48:32.197"> <testcase name="Test3" file="/home/satish/Documents/gtestNew/sqrt_test.cpp" line="16" status="run" result="skipped" time="0" timestamp="2022-05-14T18:48:32.197" classname="Suite2"> <skipped message="/home/satish/Documents/gtestNew/sqrt_test.cpp:18&#x0A;"><![CDATA[/home/satish/Documents/gtestNew/sqrt_test.cpp:18]]></skipped> </testcase> </testsuite> </testsuites>

I would like to point out that the tag testsuites which is a consolidation of all the testsuite does not have an attribute skipped.
However, the attribute is present in tag testsuite which does show the count of disabled and skipped.

@satishsingh0077 satishsingh0077 changed the title Xml Generation from Google test does not show skipped test cases Xml Generation from Google test does not show skipped test cases count in tag testsuites May 14, 2022
@ourarash
Copy link

ourarash commented May 15, 2022

Here is another example:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="3" failures="0" disabled="0" errors="0" time="0" timestamp="2022-05-13T17:38:54.980" name="AllTests">
  <testsuite name="MyTestSuite" tests="3" failures="0" disabled="0" skipped="1" errors="0" time="0" timestamp="2022-05-13T17:38:54.980">
    <testcase name="Test1" status="run" result="skipped" time="0" timestamp="2022-05-13T17:38:54.980" classname="MyTestSuite">
      <skipped message="tests/gtest_demo/fib_test.cc:10&#x0A;"><![CDATA[tests/gtest_demo/fib_test.cc:10
]]></skipped>
    </testcase>
    <testcase name="Test2" status="run" result="completed" time="0" timestamp="2022-05-13T17:38:54.981" classname="MyTestSuite" />
    <testcase name="Test3" status="run" result="completed" time="0" timestamp="2022-05-13T17:38:54.981" classname="MyTestSuite" />
  </testsuite>
</testsuites>

Notice that testsuite tag has skipped but testsuites does not.

This is the example that I ran:

TEST(MyTestSuite, Test1) {
  ::testing::GTEST_FLAG(output) = "xml:out.xml";
  GTEST_SKIP();

  EXPECT_TRUE(1 == 1);
}
TEST(MyTestSuite, Test2) {
  EXPECT_TRUE(1 == 1);
}


TEST(MyTestSuite, Test3) {
  EXPECT_TRUE(1 == 1);
}

@satishsingh0077
Copy link
Author

Is there any update on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants