How do you mark a test as something like “flimsy” in Google Test?

We have a test that fails if the test suite is not running with administrator privileges. This is the expected behavior. However, we want to return something other than success from the test suite so that someone remembers to go back and try the tests again as admin.

Is there a way to tell Google Test that the test did not work, but actually failed?

+4
source share
2 answers

No, I don’t think there is a way to tell GoogleTest that the test did not fail, but failed.

However, the closest, probably EXPECT, non-fatal statement: http://code.google.com/p/googletest/wiki/V1_6_Primer#Assertions

The test will fail, but the test function will continue, which is similar to what you want.

+1
source

I would single out the component in two parts (two projects). For a project in which there is a kernel driver, verification is required to verify, and another project mocks it for testing purposes, so the test does not fail.

+2
source

Source: https://habr.com/ru/post/1393035/


All Articles