简体   繁体   中英

How does one mark a test as anything like “inconclusive” in Google Test?

We have a test that fails if the test suite is not run with administrator rights. This is 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 hasn't failed, but hasn't really succeeded either?

What I'd do is separate out the component into two pieces (two projects). The project that has the kernel driver requires admin to test, and the other project mocks it for test purposes so the test doesn't fail.

No, I don't think there is a way to tell GoogleTest that a test has not failed, but has not passed either.

That said, the closest is probably EXPECT, a non-fatal assertion: http://code.google.com/p/googletest/wiki/V1_6_Primer#Assertions

The test will fail, but execution of the test function will continue, which seems to be what you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM